Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display result in the same jsp page after processing data in a servlet

 
sumita mukherjee
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a jsp search page. When user clicks on the submit button, the search text would go to a servlet, get processed and the results should be displayed back in the same jsp page.

Could anyone please give me a hint as to how to proceed. I have tried request.forward, but somehow cannot get the control back to the jsp page to display the result, after processing.

Thanks for yoiur help in advance.

Regards,
Sumita
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try using request.include(request,response) which includes the generated response into the target resource.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65113
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sumita mukherjee wrote:I have tried request.forward, but somehow cannot get the control back to the jsp page to display the result, after processing.

Without an explanation of what the problem is, no help can be forthcoming. Please read this for more information.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65113
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ruquia tabassum wrote:try using request.include(request,response) which includes the generated response into the target resource.

And how will that help?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic