This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSP and the fly likes Session validation code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Session validation code" Watch "Session validation code" New topic

Session validation code

Vasudevan Gopalan
Ranch Hand

Joined: Aug 29, 2003
Posts: 67
Hi all,
I am using Tomcat 4.1.29.I want to incorporate session validation code in my JSP Pages.Can any one give me sample session validation code .I dont want to use servlets for validating session.


Vasudevan Gopalan
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Vasudevan -
what do you mean by "session validation" is it something like checking whether the sessionn already exists or not?
if so, then:

public boolean isNew()
Returns true if the client does not yet know about the session or if the client
chooses not to join the session. For example, if the server used only cookiebased
sessions, and the client had disabled the use of cookies, then a session
would be new on each request.
Returns: true if the server has created a session, but the client has not yet
IllegalStateException - if this method is called on an already invalidated

is that what you're after?

I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
I agree. Here's the link:
subject: Session validation code
It's not a secret anymore!