Hi,

can someone give me some help, I stucked here almost 2 days...

this is what I did:

1. searchForm.jsp will submit to a servlet

2. the servlet store the search results as an object  by coding:
        request.setAttribute(object name, value);

3.  then the servlet will forward to a jsp page to display the data there.


        RequestDispatcher rd =
getServletContext().getRequestDispatcher("/employers/ge/results.jsp?mode=groupSearch");
        rd.forward(request,response);


4. results.jsp will retrive data out by coding:
       request.getAttribute(object name, value);


5. results.jsp will loop through and display all records
   lines, each line contains couple key attributes such
   as name, address, phone... the name field will be a
   hyperlink to details.jsp page to show all the   attributes of this
records.

6.  results.jsp will store the retrived object in a session variable so when
the name field link bring to the detail page,the same object can be retrive
out there.


7. the results.jsp will dynamic showing [previous] [next]
   link if the total record count of the results more  than 10.

8. on the bottom of results.jsp will has a hyperlink "begin a new search"
bring user back to the
searchForm.jsp.


the above steps are all works fine if I do one search after another.


PROBLEMS:

1. if I click the browser back button to
previous result page, it looks like the previous results still showing
there, but since the session variable already overwriten by the lastest
search results, so the details page will has wrong data.

2. if I go back through browser to previous results page and that page has
[previous] [next] link, if I click either [previous] or [next] link, then
the results will mess up, it will based on the latest results count to
recalculate the page number instead of the previous results count.


can some one point out how I can retain the old data stroed in session
variable if the browser back button clicked??

appreciate your help.

Helen

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to