How to send an action to servlet through hyperlink and display the data on to jsp.

Reply

Join Date: Oct 2006
Posts: 2
Reputation: seluru is an unknown quantity at this point 
Solved Threads: 0
seluru seluru is offline Offline
Newbie Poster

How to send an action to servlet through hyperlink and display the data on to jsp.

 
0
  #1
Oct 7th, 2006
Hi all,
My code is as follows

  1. <a href="/web/contacts/contactSearch.jsp">Search</a>

when i click this link, it will go to contactSearch.jsp. I want to send an action to the servlet when clicking this link, and display the data from the servlet on the contactSearch.jsp.

The data I mentioned is a dynamic data, which I am getting from backend through "collections".

Please help me on this....really stuck at this point
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: How to send an action to servlet through hyperlink and display the data on to jsp.

 
0
  #2
Oct 8th, 2006
instead of the URI for the result JSP, place the URI for the servlet (as mapped in the web.xml deployment descriptor) in the link tag.
Then in the servlet place the result of its operation in the request or session (if it should be persistent between requests) and forward the request to the result jsp with request.getRequestDispatcher().forward() (or something like that).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2
Reputation: seluru is an unknown quantity at this point 
Solved Threads: 0
seluru seluru is offline Offline
Newbie Poster

Re: How to send an action to servlet through hyperlink and display the data on to jsp.

 
0
  #3
Oct 8th, 2006
Could you please be more specific...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC