File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Use of request dispatcher's include method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Use of request dispatcher Watch "Use of request dispatcher New topic
Author

Use of request dispatcher's include method

lekurwale amol
Ranch Hand

Joined: Apr 22, 2010
Posts: 55
Hi,
I am having a requirement wherein I want to include a jsp (request dispatcher.include). The jsp sets a value of a text field and control returns to the calling servlet. There after from the servlet, I redirect to some other location
My question : Will the jsp in any case be 'transported' to client? Or it will just be evaluated on server and control returned.
Also, how can I access the text field value set in that jsp?

Regards,
Amol
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

If you use the original response object to include the JSP, then the content of the JSP will be sent to the client browser (but you can't redirect after that). If you don't want to send the content generated by the JSP to the client, you should use HttpServletResponseWrapper to build a dummy response object to include the JSP. That response object can store the content generated by the JSP in a String. You can also try to find the value of the text field in the String...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use of request dispatcher's include method
 
Similar Threads
requestdispatch - servlet to servlet in iplanet( anyone plzzzzzzz!!!!)
jsp
Prevent servlet response from being cache
RequestDispatcher include and forward
How to pass an arrayList from a JSP to a servlet.