O'Reilly logo

Java™ After Hours: 10 Projects You'll Never Do at Work by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Restricting Access Based on Time of Day

The list of things you can do with filters is endless. You can convert, for example, the data sent to a servlet from XML to HTML, or even from French to English. You can add a common header or footer to all web pages in your site. You can use a single filter as a gateway to your entire site. You can restrict access to a JSP or servlet in case multithreading issues become a problem (on most web servers, multiple threads from multiple users can execute the same servlet or JSP code at the same time).

You can even restrict access to a resource based on the time of day. Say you have a company full of employees and don't want them to access a game on your site during the day. Here's what the restricted starting ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required