This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes How to hide a particular web page on all friday's Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "How to hide a particular web page on all friday Watch "How to hide a particular web page on all friday New topic
Author

How to hide a particular web page on all friday's

Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Hi friends,
In an interview, the interviewer asked me that he wants to hide a web page on every fridays.
I replied that once if we know the Server date and checking the day == friday, we can redirect the page using response.sendRedirect option. But he was not happy with my anser. Is there any other possible solutions are available.
Thanks & Regards,
M.S.Raman
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 852
His objection might have been that sendRedirect(...) makes the client have to make another http request to the server. include(...) or forward(...) would behave similarly, but the client wouldn't even know they had occurred behind the scenes.
Servlet filters are also a nice place to put this type of behaviour especially if say more than one page had blocked access on fridays. That way you put the logic in the filter and you don't have to change the servlet code.
steve - http://www.jamonapi.com - a fast, free, open source performance tuning api
download at http://www.javaperformancetuning.com/tools/jamon/#DownloadingJAMon


http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17234
    
    1

And after I had replied to the other duplicate post. Please refrain from posting the same post twice.
Thanks
I am closing the other thread, since I like the answer here better.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Originally posted by steve souza:
His objection might have been that sendRedirect(...) makes the client have to make another http request to the server. include(...) or forward(...) would behave similarly, but the client wouldn't even know they had occurred behind the scenes.
Servlet filters are also a nice place to put this type of behaviour especially if say more than one page had blocked access on fridays. That way you put the logic in the filter and you don't have to change the servlet code.
steve - http://www.jamonapi.com - a fast, free, open source performance tuning api
download at http://www.javaperformancetuning.com/tools/jamon/#DownloadingJAMon

Thanks Steve.
- M.S.Raman
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to hide a particular web page on all friday's
 
Similar Threads
Ajax Patterns
Enabling links according to user's authorization
How to hide a particular page on all friday's
Modify components in backing bean
Using Post method for frame src