you can create a servlet filter.

i have used a custom tag to be there in each .jsp that checks the session 
attribute. another way of doing is to use the template pattern, that is 
create a base action whose execute method checks the session attribute and 
calls the executeImpl abstract method, the subclasses of the base action 
implements executeImpl.

Regards,
Basudeb Acharya
Tata Consultancy Services Limited
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com




"Abhimanyu Koul" <[EMAIL PROTECTED]> 
06/12/2006 04:03 PM
Please respond to
"Struts Users Mailing List" <user@struts.apache.org>


To
"Struts Users Mailing List" <user@struts.apache.org>, <[EMAIL PROTECTED]>
cc

Subject
Re: sessions






but the problem with that approach would be that i would have to write 
same
code for every action or call the same method for each action. i want that
it should be automatically done for each action at the requestprocessor
level so that every developer doesn't have to worry about it. ?


Regards,
Abhimanyu Koul
FinEng Solutions (P)  Ltd.
Mobile : +91 9819510090
----- Original Message -----
From: "Mukta" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <user@struts.apache.org>
Sent: Monday, June 12, 2006 3:28 PM
Subject: RE: sessions


> If you have some session attributes in your application, then it is very
> easy to do so. Whenever a user directly tries to access any action, 
first
> try to get that session attribute. If it is null, redirect to login 
page.
>
>
>
> -----Original Message-----
> From: Abhimanyu Koul [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 12, 2006 3:16 PM
> To: Struts Mailing list
> Subject: sessions
>
> hi all!
> i want to use session validation in my application. no user should be
> allowed to view any page without logging in. if any user say copies the
> action from the properties window into the address bar of the browser, 
he
> should be directed to the login page. no error message should be shown
> neither the user should be allowed to do some operations without logging
in.
>
> can we use some feature of requestprocessor for that. what are the 
various
> methods to achieve that.
>
> regards
> Abhimanyu Koul
> FinEng Solutions (P)  Ltd.
> Dani Compound,
> 158, Vidyanagari Marg,
> Kalina, Santacruz (East),
> Mumbai - 400 098
> Mobile : +91 9819510090
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

ForwardSourceID:NT0001BAEA 
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


Reply via email to