Hi there,

I think both the functions take relative URLs instead of absolute URLs that
you are giving. So try using relative URLs.
You can set an attribute in "request" (not response) by setAttribute(String,
Object) method and then you can use <jsp: forward> tag to go to the other
page. Unlike sendRedirect() your request would not be reset and you would be
able to get the value of your attribute.

regards
Y
----- Original Message -----
From: hua ge <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 12, 2000 11:07 PM
Subject: communication between jsp and servlet


> 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/comb
o.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

===========================================================================
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