Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Struts session

Posted on 2009-04-06
1
Medium Priority
?
204 Views
Last Modified: 2013-11-24
Hi,

I am making my application in Struts. I have a action and this action calls another java class which checks whether the username is correct and also checks for the role. Now i want to set in session, username and role. But role is checked only in the java class. So when the action calls this class, this class returns a boolean value and this value is checked to actually see the page to direct the user. But i want to actually create a session first here. How do i do it>
0
Comment
Question by:SunScreenCert
1 Comment
 
LVL 4

Accepted Solution

by:
aman123_123 earned 500 total points
ID: 24083887
You are better off doing the session checking and session related tasks in a filter. This way you will not have to validate the session in every action and you can add/remove the filter at any point of time.

Please have a look at the following link.
http://www.experts-exchange.com/Programming/Languages/Java/J2EE/Frameworks/Struts/Q_23823126.html

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question