This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Showing result in same jsp page  RSS feed

 
imran quazi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My friend has a situation: a jsp page having links to different project specific details. When user clicks on any link it will fetch the related details from the DB and should show that in the same page. He's stuck in the thing that it has to be shown in the same page.

Please suggest.

Regards.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's say that each link retrieves data via servlets.
If the servlet forwards the response to the same jsp page, there should not be any problem.
The jsp page shows links and data grabbed from the request. If there's no data in the request, only links will be shown. If a servlet is called, it retrieves data from the db, puts it in an array (for example), and puts the array in the response. Then the servlet forwards the request back to the jsp.
The same jsp shows, but this time data will be displayed, as it has been put into the request.

I suggest that your friend read something about request forwarding.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!