• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic