hi!
I'm not sure what effect you like to achieve... but if the JSP
acts as view for the servlet that processes the data,
your best bet is to forward the request instead of redirecting:
(req, res are the HttpServletRequest/Response-references originally passed
to the servlet)
req.setAttribute ("name", yourresult);
RequestDispatcher rd =
getServletContext().getRequestDispatcher("path/to/your.jsp");
rd.forward(req,res);
you may add any object reference to the request with the
'setAttribut("name",objref)' method.
wrap your result inside an object and inside the jsp use
'getAtrribute("name")' to fetch the
reference to that object and thus your data.
hope this helps.
greets
btw, there is an "include"-method as well in the RequestDispatcher-class
which includes
the resource in the response and returns control back to the caller.
> Hi Guys,
>
> I am pretty new to developing in the Web tier of
> the J2EE and I was wondering about the following:
>
> - I can invoke a JSP from a Servlet, redirecting the
> the response page from the sevlet, and pass to it the
> result of an internal processing, something like this:
>
> redirect("test.jsp" + "?xml=" + myProcessingResult);
>
> I think there is a limitation on the length of the URL
> that can be composed this way, that is, all the string
> passed as a parameter to 'redirect' must be no longer
> than 240 characters.
>
> Could someone tell me if this is true or not?
>
> Thanks in advance,
>
> tiz
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
>
> To change your membership options, refer to:
> http://www.sys-con.com/java/list.cfm
>
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm