File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes RequestDispatcher.include( ) - help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDispatcher.include( ) - help!" Watch "RequestDispatcher.include( ) - help!" New topic
Author

RequestDispatcher.include( ) - help!

Gail Mikels
Ranch Hand

Joined: May 07, 2001
Posts: 634
I'm working with the RequestDispatcher's include() method. In my first servlet, I'm using the PrintWriter before & after the call to include(), and every documentation I've seen says that this should work, but for some reason, it doesn't!
The servlet that I'm including creates an html tag, gets a PrintWriter, and sends the tag to out.println().
I'm getting the tag back in my first servlet, but none of the PrintWriter statements in the first servlet work after that point. Any hints??
Thank you,
Gail
[ August 23, 2002: Message edited by: Elaine Micheals ]

Gail Mikels
Gail Mikels
Ranch Hand

Joined: May 07, 2001
Posts: 634
never mind... Here's what happened - the second servlet was opening, and CLOSING a PrintWriter. I omitted the line in the second servlet which closed the PrintWriter, and everything's happy now!
*Gail
 
 
subject: RequestDispatcher.include( ) - help!
 
Similar Threads
Add Cookie to HttpServletResponseWrapper
How to use tooltip in Struts2
setting configuration file path in weblogic...
SocketChannel and OutputStream
Servlet chaining