This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Listeners help needed! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Listeners help needed!" Watch "Listeners help needed!" New topic
Author

Listeners help needed!

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

Guys,

I have some doubts related to Listeners. I actually have a database called LOGIN and I have one table that has the username and password details. I have a page that asks for the username and password and upon submit, it checks the values in a database and takes me to another page called inbox. I want to try this code using Listeners. The K&B book says this on page 168. My question is what will be the param-name and param-value for this?? And how will my attribute class look like?? Anyone help me please!!

Thanks in advance.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

It is best to use declarative security rather than have a listener check credentials every time. If you still want to do it, use the isUserInRole method to check if the user is logged in. I am not sure why you would want an attribute to be associated with this filter.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Listeners help needed!
 
Similar Threads
authentication in jboss
How to Encrypt and Decrypt the password in JSP
ServletContextListener Doubt??
Connecting JSP to MySQL
Doubt in ServletContextListener