Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: jsp redirect


Message #1 by "Massimo LoVoi" <maslv@q...> on Fri, 28 Jun 2002 09:39:32 -0700
This is a multi-part message in MIME format.

------=_NextPart_000_0002_01C21FE2.36F5BEE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Alternatively use the you can either forward the request to the next jsp or
include the output of that jsp using the RequestDispatcher.

In the JSP something like:
  request.getRequestDispatcher().forward(?/newJSP.jsp?);
or to include the jsp?s output in the current page
  request.getRequestDispatcher().include(?/newJSP.jsp?);

or more clearly:
<%
RequestDispatcher rd = request.getRequestDispatcher();
rd.forward(?/newJSP.jsp?);
%>

This includes all parameter information as received, and any other HTTP info
if required as the request object is forwarded.

This is preferable to storing it in the session if the parameter info is
temporary, but if it needs to be retained the session works fine.

Hope this helps,
Andrew
Professional Java Servlets 2.3
http://www.amazon.com/exec/obidos/ASIN/186100561X
http://www.amazon.co.uk/exec/obidos/ASIN/186100561X

-----Original Message-----
From: Julio Oliveira - Buenos Aires [mailto:jOliveiraAr@y...]
Sent: 29 June 2002 22:35
To: Pro_JavaServer_Pages
Subject: [pro_jsp] RE: jsp redirect

Put all the variables in a Session


   Julio Oliveira
Buenos Aires - Argentina
Java Developer - Instructor - Cursos @-Mail
-------------------------------------------
JOliveiraAR@y...
Oliveira_julio@y...

***********************************************************************
-----Mensaje original-----
De: Massimo LoVoi [mailto:maslv@q...]
Enviado el: viernes 28 de junio de 2002 13:40
Para: Pro_JavaServer_Pages
Asunto: [pro_jsp] jsp redirect
Hi
Is there a way to redirect a jsp page to another jsp carrying over all the
variables and their values from the first page to the second?
I cannot use something like the following
<%
response.setStatus(response.SC_MOVED_TEMPORARILY);
response.setHeader("Location","page2.jsp?field1=value1&field2=value2");
%>
because my querystring is very big, and it will be truncated.

Thanks
Massimo



--- Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 
--- Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 



  Return to Index