Solved

Struts session

Posted on 2009-04-06
1
198 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 125 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
where is session ID cache stored 1 57
maven project error 5 77
more than one jdk and one jre 1 57
tomcat startup error 5 132
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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.

685 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