Hi everybody,
First, I'm using Tomcat 3.2.1 with apache 1.3.12 on Redhat 7.0 ...
Well, I've migrated a JSP website from JServ/GNuJsp to Tomcat and I'm facing
a lot of difficulties with redirection.
1 - There is in each JSP pages a login check, which relies on a session bean
so basically :
<jsp:usebean Id="mySession" scope="session" class="mybeans.BSession">
<% ...
if (!mySession.isConnected())
{
response.sendRedirect(response.encoreRedirectUrl("/html/timeout.html"));
}
...
%>
So now, if I try to access the previous sample page after a timeout on the
session for example, I sometime receive the http header in the document
(?!?!?), sometime a 'DOCUMENT MOVED' and sometimes the right result !
Some people told me to use jsp:forward instead, but If I want to forward to
an html document (not jsp), I'm receiving a 404 not found with
/myContext/myContext/html/timeout.html (and of course if I want to forward
to a html file from another context, what can I do ???)
2 - But now imagine I have page1.jsp with a form, which post to page2.jsp,
on which I check value and if ok forward to page3.jsp, else forward to
page1.jsp ...right ? So page3.jsp will also receive the post data from page1
if I use <jsp:forward>, which is normal since it's a direct forward... Is
there a way to clear the post stuffs ???
3 - I also got the same probleme with my errorPage (404 not found), which
I've solved by setting autoflush to false !
So my questions are :
1 - Does response.sendRedirect() end the execution of the jsp page (or
should I add a 'return' just after the 'sendRedirect' ???)
2 - How sendRedirect works ??? sometimes 404, sometimes HTTP, does it
depends of a think I've not seen ???
3 - does response.reset() clear EVERYTHING in the response ???
4 - Should I keep the autoflush false, and if so, what the preconized size
for the buffer ???
Thanks a lot,
Laurent.
_______________________________________________________
Laurent LAUBIN S2M
Ingénieur système 2, rue des champs - BP 2282
Tél : +33 232 64 33 76 27950 St-Marcel - France
Fax : +33 232 21 25 99 http://www.s2m.fr/
_______________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]