JSP help, please.

J

Jason

Hi, all,
I have two JSP pages, one is searchCriteria.jap and another is
searchResults.jsp,
I need to have two buttons in searchResults.jsp (revsie and new search), here is
my question:
in searchCriteria.jsp, if user typed '123456780' in SSN field, then displayed
nothing in searchResults.jsp becasue there is no such SSN in database, then when
user click 'Revise' button in searchResults.jsp, how can I pass current
SSN(123456780) to searchCriteria.jsp, that user can see what's wrong and
modified 123456780' to '123456789'? Do I need another JSP file to handle this
request or same file(searchCriteria.jsp) can do this?

please help.

Thanks in advance.
Jason
 
D

Dirk Michaelsen

Hi,
in searchCriteria.jsp, if user typed '123456780' in SSN field, then displayed
nothing in searchResults.jsp becasue there is no such SSN in database, then when
user click 'Revise' button in searchResults.jsp, how can I pass current
SSN(123456780) to searchCriteria.jsp, that user can see what's wrong and
modified 123456780' to '123456789'? Do I need another JSP file to handle this
request or same file(searchCriteria.jsp) can do this?

use the request.setAttribute method to pass the search value to the
request stream before forwarding the request to your searchCriteria.jsp.
In searchCriteria.jsp use the request.getAttribute method to retrieve
the passed value (will be null if there is none).

cu
Dirk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top