Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Display information related to that link  RSS feed

 
sree visu
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently doing a sample application.Right now I have a JSP page that generates a list of Gadgets from the database.(As shown in (1))





I would like to make them as Links and when the user selects a link i would like to display the information about that gadget
like gadget name,Gadget manufacturer id etc... in a JSP page

suppose if i modify the dynamic generation of my list as links like the one mentioned below




How should i design my JSP page

ie how to know which particular gadget link was clicked?.. so that i could populate the related information in a JSP Page.

Please help me.



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65828
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URL of the anchor should contain all the information you need to process the request on the server. This is plain and simple HTML and HTTP.
 
sree visu
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes ofcourse the URL of the anchor tag contains all the information about where what request to send but my question was i would like to direct it to same JSP page but based on the gadget selected the page has to display unique information.Sorry for not framing the question clearly
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65828
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the server fetches the information from wherever it's going to get it (DB? file system?) it places it in a request-scoped variable. The JSP page tests to see if the variable is present, and if so, displays the information within it.

Of course, this would be much more efficient using Ajax, where the entire page would not need to be re-displayed, but rather, just the information obtained and added to the existing DOM.
 
sree visu
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much Bear Bibeault for your reply.Thats really amazing .You have got a great experience in this field
 
Sudhansu Maharana
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sree visu wrote:Thank you so much Bear Bibeault for your reply.Thats really amazing .You have got a great experience in this field


Hi am a new user
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudhansu Maharana wrote:Hi am a new user


Welcome to javaranch
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!