how to apply time constraints to JSP page

S

snehapshinde

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!
 
W

Wojtek

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"
 
S

snehapshinde

(e-mail address removed) wrote :


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

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.
 
O

Owen Jacobson

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
 
W

Wojtek

Owen Jacobson wrote :
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.

If the re-direct is to the same page, which then contains a refresh set
for 0 seconds to the new page, then the page will effectively
over-write the cached copy for that page.

Hmmm, that is confusing.

Page 1 (full content) - time out, refreshes to itself after X seconds
Page 1 (dummy content)- refreshes after 0 seconds to Page 2

The cache for Page 1 now contains the second version (dummy content)
 
U

umeshkinekar

Owen Jacobson wrote :





If the re-direct is to the samepage, which then contains a refresh set
for 0 seconds to the newpage, then thepagewill effectively
over-write the cached copy for thatpage.

Hmmm, that is confusing.

Page1 (full content) -timeout, refreshes to itself after X secondsPage1 (dummy content)- refreshes after 0 seconds toPage2

The cache forPage1 now contains the second version (dummy content)

I don't understand your solution. Let me explain the problem again,
when we logout we are redirected to home page and it is not possible
to go to previous page by hitting back button on browser(recall page
is redirected automatically in our case and not by logging out, But it
doesn't make any difference,does it?), Should I make some settings in
browser through JSP page(Is it possible!)or there is another way?
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top