Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Site tracking

Status
Not open for further replies.

mfuna

Programmer
Jul 31, 2000
6
LU
Hi,

How can I use JSP to make sure a user has logged in before I handle the request?

Mike
 
Dear Mike,

This is not the Tek-Tips Psychic Hotline Forum.

> make sure a user has logged in

Logged in to what?

-pete
 
I need restrict an access to any pages without user login on my site

Mike
 
hello mfuna
use cookies or session to track whether user logged in or not? and u can aslo user cookies to find out howmany times user logged in indstead of database
bye
soma sekhar
 
Hi, vempadu

fnx, i know it
i need to control "session on start" and "session on end" events.

i've found an example of this techniques, but i don't know how i can use it in my jsp

----
MyListener.java
----
import javax.servlet.http.*;
import javax.servlet.*;

public class MyListener implements HttpSessionBindingListener {

ServletContext context;

public void ODSessionListener(ServletContext context) {
this.context = context;
}

public void valueBound(HttpSessionBindingEvent event) {
// called when this class is put [putValue] into the session
System.out.println(" ** [valueBound] ** Someone just bound my listener to a session!");
}

public void valueUnbound(HttpSessionBindingEvent event) {
// called when this class is removed [removeValue or invalidate] from the session
System.out.println(" ** [valueBound] ** Someone just bound my listener to a session!");
}

}
----
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top