Solved

Struts session

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
powerN  challenge 3 64
table example 4 29
java jdbc batch example 8 35
runtime exception 2 28
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…
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 …
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.

803 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