Hi,all
I have a jsp page which pass a value to a servlet, the servlet then need go
to the database and select somevalues based on the parameter passed from the
jsp page as the where clause. the values will be stored in a vector. after
that, the servlet will be redirect back to the jsp and passing the vector
back to jsp.

I encountered two questions here:
Q1. *** regarding page redirect ***

I tried following code in my servlet to do the redirect. it does not
redirect to the target at all.

String url = res.encodeRedirectURL("http://dre.col.loc/formular/combo.jsp");
res.sendRedirect(url);

I also tried:
RequestDispatcher x =
getServletContext().getRequestDispatcher("http://dre.mamsi.loc/formular/combo.jsp");
  x.forward(req,res);

it does not work either.

Q2. **** regarding pass data from servlet back to Jsp ***

other than put the vector in a session variable, how can I put the vector to
the request and send back to the jsp?
using response.setAttribute("name", value)?? then will the redirect make the
attribute lost?

Could someone give me a hint???

Regards

Helen
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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