This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSP and the fly likes Can and How do you pass a Document Object from servlet to a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Can and How do you pass a Document Object from servlet to a JSP" Watch "Can and How do you pass a Document Object from servlet to a JSP" New topic
Author

Can and How do you pass a Document Object from servlet to a JSP

Ray Smilgius
Ranch Hand

Joined: Jan 29, 2001
Posts: 120
I need to pass a Document Object from servlet to JSP:
I basically parse the input Stream into a doc such as::
InputStream in = urlConn.getInputStream();
DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
DocumentBuilder db=dbf.newDocumentBuilder();
Document doc = db.parse(in);
System.out.println("my doc "+ doc.toString()); // this gives me null???any ideas why?
I need to pass doc to template.jsp and to process the doc on the template.jsp
Thanks in advance


------------------
Sun Certified Java Programmer
Sun Certified Java Developer
I-Net Certified
A+ Certified
Network+ Certified
MCP


SCJO, SCJD, SCWCD, I-Net+, A+, Network+, MCSD, MCDBA, MCP, MCT
David Kane
Ranch Hand

Joined: Sep 20, 2001
Posts: 65
I posted an answer to this in the XML forum.
Dave
------------------
David Kane
david_kane@houseofyin.com
Author of Software Architecture: Organizational Principles and Patterns
http://www.vraps.com
http://www.houseofyin.com


David Kane<BR> <A HREF="mailto:david_kane@houseofyin.com" rel="nofollow">david_kane@houseofyin.com</A> <BR>Author of <A HREF="http://www.amazon.com/exec/obidos/ASIN/0130290327/ref=ase_electricporkchop/103-0514572-3811868" TARGET=_blank rel="nofollow">Software Architecture: Organizational Principles and Patterns</A><BR><A HREF="http://www.vraps.com" TARGET=_blank rel="nofollow">http://www.vraps.com</A><BR><A HREF="http://www.houseofyin.com" TARGET=_blank rel="nofollow">http://www.houseofyin.com</A>
Ray Smilgius
Ranch Hand

Joined: Jan 29, 2001
Posts: 120
Thanks when I get back on that project I will try this code.

Thanks
Ray Smilgius
------------------
Sun Certified Java Programmer
Sun Certified Java Developer
I-Net Certified
A+ Certified
Network+ Certified
MCP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can and How do you pass a Document Object from servlet to a JSP
 
Similar Threads
Can I load a xml string versus reading a file
Passing Document from servlet to JSP see code
need to get response xml string back from servlet to jsp page
trouble passing info from servlet to jsp
How to pass a parsed XML Document object from servlet to JSP??