File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Malli Raman
Ranch Hand
Posts: 312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 862
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Malli Raman
Ranch Hand
Posts: 312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic