Solved

Struts session

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to setup 18 80
Connect to IP Camera using Java 4 112
wordsWithoutList  challenge 24 77
array220 challenge 8 48
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now