Re: how to apply time constraints to JSP page



On Oct 8, 12:37 am, snehapshi...@xxxxxxxxx wrote:
On Oct 6, 9:26 pm, Wojtek <nowh...@xxxxx> wrote:

snehapshi...@xxxxxxxxx wrote :

I have created a timer thread on the server machine. Whenever the
particular time is reached all the users should be redirected to
another page. How can this timer thread be interfaced with oher
servlet classes. Should I pass the HttpSevletResponse object to the
thread class constructor and then in the run method redirect the page
using response object (I tried with it but it is not working) or there
is some other way of doing it. Plz help!

Use the HTTP Meta tag refresh and point the refresh to the other page.
Google "http refresh"

--
Wojtek :-)

Thanks for that! It is quite useful information for me. But still
there is some problem. As soon as the the page redirects to the
another page, the user should not be able to go back to previous page.
How can I prevent that.

You can't. You *can* stop them from loading a new version of that
page by having the server refuse to serve the page any more, but you
can't retroactively remove the already-downloaded copy from their
browser.

How you go about blocking access is up to you; I'd recomment a filter
(servlet filter, if you're just using the servlet API, or whatever
filtering or interception capabilities your framework offers
otherwise), so that the logic can be applied to any page or servlet
without having to modify the page itself.

-o
.



Relevant Pages

  • Re: How can we know if a HttpServletResponse has been redirected ?
    ... >> I have a filter (let say a servlet filter) and I want to know if the ... >> response has been redirected by the application before. ... > opportunity to redirect the response before your filter sees it, ...
    (comp.lang.java.programmer)
  • RE: Redirect script no longer works after SP1
    ... Thank you for posting to the SBS Newsgroup. ... I understand that you want to redirect ... Interface Filter to achieve this function. ...
    (microsoft.public.windows.server.sbs)
  • Re: New to JSP world
    ... via a supplied java based API that was written by my company. ... If the e-mail address is not found I need to redirect to an eror page. ... I personally prefer Servlet over Scriptlet because I want to keep java code separate from the jsp. ...
    (comp.lang.java.programmer)
  • IE6 macht Probleme mit multipart/form-data Formularen und folgendem Redirect
    ... Man könnte sich aber auch ein INPUT ... mit Typ FILE denken -> Formular zum Upload von Dateien. ... Das Servlet erhält die korrekte POST-Transaktion, ... Nur IE6 ignoriert das Redirect. ...
    (microsoft.public.de.german.inetexplorer.ie6)
  • Re: How can we know if a HttpServletResponse has been redirected ?
    ... Filter then only previous filters in the filter chain will have had an opportunity to redirect the response before your filter sees it, and any filter that does so is poorly designed indeed if it passes the request/response pair on down the chain afterward. ... More generally, there is no good way to determine whether a plain ServletResponse or HttpServletResponse has been previously redirected, but if you anticipate the need in advance then you can wrap the response it in a custom wrapper that will record or block such events. ...
    (comp.lang.java.programmer)