I can use  getSesssion and setSession in the action class but I need to access
session variable in my java bean where I perform my business logic, not in
action class methods. (java beans are called from action class). I hope I am
clear this time.

Thanks,
Mallik


--- Martin Gainty <[EMAIL PROTECTED]> wrote:
> struts-config identifies a forward to an identifier
> The identifier is associated with the implementted action Class
> The action class contain execute methods which reference 
> HTTPServletRequest/HTTPServletResponse parameters
> which can getSesssion and setSession for whatever parameter you desire
> Is there something specific you want?
> Martin-
> ----- Original Message ----- 
> From: "Mallik" <[EMAIL PROTECTED]>
> To: <user@struts.apache.org>
> Sent: Wednesday, April 13, 2005 8:08 PM
> Subject: accessing session variables in java Bean(In business logic Layer)
> 
> 
> > Hi
> > I use plain java beans for model/business layer.
> > I have a question regarding accessing session variables in java Beans(In 
> > model
> > Layer). I can pass session variables from action class but is there any 
> > other
> > way I can access session variables directly by extending any class.
> > Because I need "session.userID" every time I make an insert/update in the
> > database and I feel it is redundant passing session variables every time 
> > along
> > with the form data(DTO) to java bean.
> >
> > My example java bean code is as follows
> >
> > public class DoInsertBean
> > {
> > private DataSource dataSource = null;
> > public DoInsertBean(DataSource dataSource)
> > {
> > this.dataSource = dataSource;
> > }
> >
> >    public int insert(UserDTO user){
> >    //Insertion into database
> >    //need session variables here??
> >       }
> > }
> >
> > Thanks,
> > Mallik
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Small Business - Try our new resources site!
> > http://smallbusiness.yahoo.com/resources/
> >
> > ---------------------------------------------------------------------
> > 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]
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to