What I have right now is a JSP page that performs a query and generates a
table of results.  The name of the database object in each row of the table
is wrapped in an href tag which sends you to another JSP page(when clicked)
where the content of the document is uploaded to the server from the
database.  That's terrific, but I want the href to behave as you would
expect if you clicked on a link to a document at a website-the browser would
ask you if you wanted to save or open the file.  This is what I have going
so far:

Query results page:
<table><tr>
<td><a
href="GetContent.jsp?objectID=<%=objID%>"><%=object_name%></a></td>...
...
</table>
****************************************************************************
****************************
GetContent.jsp:
<%
   String objectID = request.getParameter("objectID");
   try{
       DatabaseSessionObject session = Session.getValue("session");
       DatabaseObject obj = session.getObject(objectID);
       ByteArrayInputStream stream = obj.getContent();

       .... Code the write the input stream to a file on the server
   }catch(Exception e){
      out.println("Error " + e);
   }
%>

/////////////////////////////////////////////////////////////
Shannon Moschetti
Creative Concepts Corporation
4949 Pearl East Circle, Suite 200
Boulder, CO 80301
[EMAIL PROTECTED]
303-448-0303 x213

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to