GeeCON Prague 2014*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
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: 861
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: 17250
    
    6

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
 
GeeCON Prague 2014
 
subject: How to hide a particular web page on all friday's