hi
I want to create an application which contain servlet and jsp and also connected with database
but i only want that login page will be open from 05:00hr to 10:00 hr before and after nobody able to access/login the page
if they do that it reject the request
how it is possible

Recommended Answers

All 4 Replies

In login page you can check time if userid password is fine and time is between 05:00hr to 10:00 hr, allow user to access pages otherwise disallow

If there is no login page. You may put same check in all pages

Is there is way through which we can set in tomcat configuration

You can put it in some common page that you include in all your pages. I am not sure about putting in tomcat configuration

why in your tomcat configuration? just because the users shouldn't be able to log in, doesn't mean your tomcat should stop working, right?
just configure your application or service right. your servlets run server side, so that should be "safe" (if you configure it decently, that is).
and add a check: onUserLogin() => if serverTime not between 5 and 10 (boundsIncluded) -> do not login and show message
and, if need be: when it becomes 10 -> force logout on all logged in users.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.