Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Struts session

Posted on 2009-04-06
1
Medium Priority
?
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Google Certified Professional - Cloud Architect

This course (1 of 3) is designed to help students who are interested in Google Cloud Platform (GCP) to become familiar with the platform, navigate the console and learn its capabilities. It will also prepare students for the Google Cloud Architect certification exam.

Question has a verified solution.

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

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…
A solution for Fortify Path Manipulation.
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.

670 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