Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use of request dispatcher's include method

 
lekurwale amol
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic