Redirect JSP Page

J

John Curley

Hi, I would like to redirect a JSP page back to the login page.
However, this is in a frame so when I redirect the page it displays
inside the frame instead of the whole page.

I tried to place the redirect in a <form ... target="top"> tag but it
didn't work.

This is what I would like to do:

1) have page 1, timeout

I did it this way

<meta http-equiv="refresh"
content="10;URL=http://localhost:8888/appname/subdir1/logout.jsp">

2) I then wanted the "logout.jsp" page to stay for 5 seconds then
redirect to login in whole window (tried a sleep, but it didn't work)

<body>
<form name="form1" action="" method="post" target="_top">
<table class="results" align="center">
<tr>
<td>Logging you out of the system. Please wait...</td>
</tr>
</table>
<p>
<%
Thread.currentThread().sleep(5000);
response.sendRedirect("http://localhost:8888/appname/subdir2/index.jsp");
%>
</p>
</form>
</body>

3) What happens is that logout.jsp does get invoked but it does not
sleep for 5 seconds. It also ignores the _top aspect of the form and
places the redirect within the frame?

I've been searching the web and trying all sorts of stuff. This seems
like it should be easy. Does anyone know a fix/workaroud?

Thanks,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top