Author Login
Post Reply
user Digest 28 May 2008 21:50:08 -0000 Issue 8055
Topics (messages 186915 through 186932):
Re: [Struts 2] Session scope
186915 by: Juan Pablo Pizarro
186921 by: Juan Pablo Pizarro
186927 by: Dave Newton
186928 by: Juan Pablo Pizarro
186929 by: Laurie Harper
186931 by: dusty
186932 by: Dave Newton
Re: [S2] Datetimepicker Formatting Questions
186916 by: Hoying, Ken
186919 by: Hoying, Ken
186922 by: Juan Pablo Pizarro
s:if test request parameter variable problem
186917 by: Mark Lester
186918 by: Juan Pablo Pizarro
186920 by: Mark Lester
186925 by: Musachy Barroso
dojo 0.4 XMLHttp requst submit progress indicator
186923 by: Jiang, Jane (NIH/NCI) [C]
Re: A form without summit?
186924 by: Laurie Harper
Are sessions confused?
186926 by: Juan Pablo Pizarro
XML Validation Problem
186930 by: Stetze2008
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_186915.ezm (zipped)I'm confused. I implemented SessionAware like:
public class CommonAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = 1L;
private static Logger logger = Logger.getLogger(CommonAction.class);
private Map session;
public void setSession(Map session) {
logger.info("SET_SESSION: " + session);
this.session = session;
}
public Map getSession() {
logger.info("GET_SESSION: " + session);
return session;
}
}
And all classes extends from it.
I use ServletActionContext.getRequest().getSession().getAttribute(XXX);
(or set), and when I started to use the session with SessionAware
implementation, I started to use this.getSession().XXX in the childs
of CommonAction.
is that correct?
As Milan, I see a diferent id in every invocation (see
logger.info("SET_SESSION..."); in CommonAction).
Any suggestion/correction?
I'm searching the log.. but for now, nothing new.
JP
2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> But I opened in diferents pc.
>
> 2008/5/28, Dave Newton <newton.dave@(protected)>:
> > You don't really state explicitly what the problem is.
> >
> > As was said, different browsers handle session creation differently: a
> > new window does *not* necessarily mean you get a new session.
> >
> > Dave
> >
> > --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
> >
> > > Hi All.
> > >
> > > I've a problem with session scope. The problem is:
> > >
> > > 1.- I open a web browser and make a login with user 1.
> > > 2.- I open a web browser and make a login with user 2.
> > >
> > > so, in the web browser 2, my user name is "1". I pressed CTRL+F5 and
> > > refresh with the correct name ("2").
> > >
> > > I've implemented SessionAware (with get and set) in my CommonAction
> > > (all other actions extends from it).
> > >
> > > To login a user and check that the user is logged, I use a
> > > LoginInterceptor.
> > >
> > > I've surfed the web and I didn't find a real solution.
> > >
> > > Regards,
> > >
> > > JP
> > >
> > > 2008/5/28, Milan Milanovic <milanmilanovich@(protected)>:
> > > > Should my action class implement SessionAware ?
> > > >
> > > > Milan Milanovic <milanmilanovich@(protected),
> > > >
> > > > thank you.
> > > >
> > > > My action package extends="struts-default", does this mean when I
> > > call
> > > > ActionContext.getContext().getSession() that I doesn't have access
> > > to session ?
> > > >
> > > > It seems to me that every creates a new session for my action
> > > class, and at least two methods doesn't have access to the same
> > > session. How can I manage to share my variable through multiple jsp
> > > pages for one action class using the users session ?
> > > >
> > > > --
> > > > Thx, Milan
> > > >
> > > > Martin wrote: Hello Milan-
> > > >
> > > > You can accomplish creation of HttpSession via
> > > CreateSessionInterceptor
> > > >
> > >
> > http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/CreateSessionInterceptor.html
> > > >
> > > > (session parameters are available via a map which is is available
> > > via)
> > > > ActionContext.getContext().getSession()
> > > >
> > > > If you would be amenable to using a IOC container I would look at
> > > > implementing Springs SessionContextAutowiringInterceptor
> > > >
> > >
> > http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/spring/interceptor/SessionContextAutowiringInterceptor.html
> > > >
> > > > HTH
> > > > Martin
> > > >
> > > > ----- Original Message -----
> > > > From: "Milan Milanovic"
> > > > To: "Struts Users Mailing List"
> > > > Sent: Wednesday, May 28, 2008 11:08 AM
> > > > Subject: Re: [Struts 2] Session scope
> > > >
> > > >
> > > > > It seems that every request have its own scope ?!
> > > > >
> > > > > Milan Milanovic wrote: Hi,
> > > > >
> > > > > I have one action class and two pages. When first page is called,
> > > in its
> > > > > execute method I remove my session variable, like this:
> > > > >
> > > > > ServletActionContext.getContext().getSession().remove("fruits");
> > > > >
> > > > > and then when form from the first jsp page is submitted user
> > > enter details
> > > > > in the second form and there I save those changed to session,
> > > too:
> > > > >
> > > > > ServletActionContext.getContext().getSession().put("fruits",
> > > fruits);
> > > > >
> > > > > Of course, I first check if there is already fruits in session. I
> > > do this
> > > > > because some maybe want to go to first page to change something
> > > and then
> > > > > to go again to the second page to continue entering other info.
> > > But, when
> > > > > I exit both page an execute method is called (with above session
> > > remove
> > > > > method), and my second page is called fruits from session are
> > > read again -
> > > > > they are not removed ?
> > > > >
> > > > > --
> > > > > Thx in advance, Milan Milanovic
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>

Attachment:
user_186921.ezm (zipped)The following are my logs (summary obviusly).
1.- The http session is the same, only change the Map of struts.
2.- The Map used as session for struts2 is changing through the invocations.
3.- The first 2 are the login with the user "1". The next 2 are the
login with user "2". The next log is a operation with user "1" but it
keeps the session of user "2"!!!. The last is the CTRL+F5 in the
browser (in a separate PC) of user "1" and then, the http session is
right.
Any idea?
...
INFO http-8182-1 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
{page=index.jsp, user=org.gblx.entities.User@(protected)}
...
INFO http-8182-1 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
{LOGIN_ATTEMPT=yes, user=org.gblx.entities.User@(protected),
page=login.jsp}
...
INFO http-8182-2 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
{page=index.jsp, user=org.gblx.entities.User@(protected)}
...
INFO http-8182-2 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
{user=org.gblx.entities.User@(protected),
page=login.jsp}
...
INFO http-8182-2 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
{user=org.gblx.entities.User@(protected),
req=org.gblx.entities.Request@(protected)}
...
INFO http-8182-2 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
{page=menu.jsp, user=org.gblx.entities.User@(protected)}
...
2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> I'm confused. I implemented SessionAware like:
>
> public class CommonAction extends ActionSupport implements SessionAware {
>
> private static final long serialVersionUID = 1L;
>
> private static Logger logger = Logger.getLogger(CommonAction.class);
>
> private Map session;
>
> public void setSession(Map session) {
> logger.info("SET_SESSION: " + session);
> this.session = session;
> }
>
> public Map getSession() {
> logger.info("GET_SESSION: " + session);
> return session;
> }
>
> }
>
> And all classes extends from it.
>
> I use ServletActionContext.getRequest().getSession().getAttribute(XXX);
> (or set), and when I started to use the session with SessionAware
> implementation, I started to use this.getSession().XXX in the childs
> of CommonAction.
>
> is that correct?
>
> As Milan, I see a diferent id in every invocation (see
> logger.info("SET_SESSION..."); in CommonAction).
>
> Any suggestion/correction?
>
> I'm searching the log.. but for now, nothing new.
>
> JP
>
>
>
>
>
> 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> > But I opened in diferents pc.
> >
> > 2008/5/28, Dave Newton <newton.dave@(protected)>:
> > > You don't really state explicitly what the problem is.
> > >
> > > As was said, different browsers handle session creation differently: a
> > > new window does *not* necessarily mean you get a new session.
> > >
> > > Dave
> > >
> > > --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
> > >
> > > > Hi All.
> > > >
> > > > I've a problem with session scope. The problem is:
> > > >
> > > > 1.- I open a web browser and make a login with user 1.
> > > > 2.- I open a web browser and make a login with user 2.
> > > >
> > > > so, in the web browser 2, my user name is "1". I pressed CTRL+F5 and
> > > > refresh with the correct name ("2").
> > > >
> > > > I've implemented SessionAware (with get and set) in my CommonAction
> > > > (all other actions extends from it).
> > > >
> > > > To login a user and check that the user is logged, I use a
> > > > LoginInterceptor.
> > > >
> > > > I've surfed the web and I didn't find a real solution.
> > > >
> > > > Regards,
> > > >
> > > > JP
> > > >
> > > > 2008/5/28, Milan Milanovic <milanmilanovich@(protected)>:
> > > > > Should my action class implement SessionAware ?
> > > > >
> > > > > Milan Milanovic <milanmilanovich@(protected),
> > > > >
> > > > > thank you.
> > > > >
> > > > > My action package extends="struts-default", does this mean when I
> > > > call
> > > > > ActionContext.getContext().getSession() that I doesn't have access
> > > > to session ?
> > > > >
> > > > > It seems to me that every creates a new session for my action
> > > > class, and at least two methods doesn't have access to the same
> > > > session. How can I manage to share my variable through multiple jsp
> > > > pages for one action class using the users session ?
> > > > >
> > > > > --
> > > > > Thx, Milan
> > > > >
> > > > > Martin wrote: Hello Milan-
> > > > >
> > > > > You can accomplish creation of HttpSession via
> > > > CreateSessionInterceptor
> > > > >
> > > >
> > > http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/CreateSessionInterceptor.html
> > > > >
> > > > > (session parameters are available via a map which is is available
> > > > via)
> > > > > ActionContext.getContext().getSession()
> > > > >
> > > > > If you would be amenable to using a IOC container I would look at
> > > > > implementing Springs SessionContextAutowiringInterceptor
> > > > >
> > > >
> > > http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/spring/interceptor/SessionContextAutowiringInterceptor.html
> > > > >
> > > > > HTH
> > > > > Martin
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Milan Milanovic"
> > > > > To: "Struts Users Mailing List"
> > > > > Sent: Wednesday, May 28, 2008 11:08 AM
> > > > > Subject: Re: [Struts 2] Session scope
> > > > >
> > > > >
> > > > > > It seems that every request have its own scope ?!
> > > > > >
> > > > > > Milan Milanovic wrote: Hi,
> > > > > >
> > > > > > I have one action class and two pages. When first page is called,
> > > > in its
> > > > > > execute method I remove my session variable, like this:
> > > > > >
> > > > > > ServletActionContext.getContext().getSession().remove("fruits");
> > > > > >
> > > > > > and then when form from the first jsp page is submitted user
> > > > enter details
> > > > > > in the second form and there I save those changed to session,
> > > > too:
> > > > > >
> > > > > > ServletActionContext.getContext().getSession().put("fruits",
> > > > fruits);
> > > > > >
> > > > > > Of course, I first check if there is already fruits in session. I
> > > > do this
> > > > > > because some maybe want to go to first page to change something
> > > > and then
> > > > > > to go again to the second page to continue entering other info.
> > > > But, when
> > > > > > I exit both page an execute method is called (with above session
> > > > remove
> > > > > > method), and my second page is called fruits from session are
> > > > read again -
> > > > > > they are not removed ?
> > > > > >
> > > > > > --
> > > > > > Thx in advance, Milan Milanovic
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > For additional commands, e-mail: user-help@(protected)
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> >
>

Attachment:
user_186927.ezm (zipped)Why are all the session user variables different?
I thought there were only two users logged in.
Dave
--- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
> The following are my logs (summary obviusly).
>
> 1.- The http session is the same, only change the Map of struts.
> 2.- The Map used as session for struts2 is changing through the
> invocations.
> 3.- The first 2 are the login with the user "1". The next 2 are the
> login with user "2". The next log is a operation with user "1" but it
> keeps the session of user "2"!!!. The last is the CTRL+F5 in the
> browser (in a separate PC) of user "1" and then, the http session is
> right.
>
> Any idea?
>
> ...
> INFO http-8182-1 org.gblx.action.common.CommonAction -
> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
> {page=index.jsp, user=org.gblx.entities.User@(protected)}
> ...
> INFO http-8182-1 org.gblx.action.common.CommonAction -
> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
> {LOGIN_ATTEMPT=yes, user=org.gblx.entities.User@(protected),
> page=login.jsp}
> ...
> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
> {page=index.jsp, user=org.gblx.entities.User@(protected)}
> ...
> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
> {user=org.gblx.entities.User@(protected),
> page=login.jsp}
> ...
> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
> {user=org.gblx.entities.User@(protected),
> req=org.gblx.entities.Request@(protected)}
> ...
> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
> ...
>
>
> 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> > I'm confused. I implemented SessionAware like:
> >
> > public class CommonAction extends ActionSupport implements
> SessionAware {
> >
> > private static final long serialVersionUID = 1L;
> >
> > private static Logger logger =
> Logger.getLogger(CommonAction.class);
> >
> > private Map session;
> >
> > public void setSession(Map session) {
> > logger.info("SET_SESSION: " + session);
> > this.session = session;
> > }
> >
> > public Map getSession() {
> > logger.info("GET_SESSION: " + session);
> > return session;
> > }
> >
> > }
> >
> > And all classes extends from it.
> >
> > I use
> ServletActionContext.getRequest().getSession().getAttribute(XXX);
> > (or set), and when I started to use the session with SessionAware
> > implementation, I started to use this.getSession().XXX in the
> childs
> > of CommonAction.
> >
> > is that correct?
> >
> > As Milan, I see a diferent id in every invocation (see
> > logger.info("SET_SESSION..."); in CommonAction).
> >
> > Any suggestion/correction?
> >
> > I'm searching the log.. but for now, nothing new.
> >
> > JP
> >
> >
> >
> >
> >
> > 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> > > But I opened in diferents pc.
> > >
> > > 2008/5/28, Dave Newton <newton.dave@(protected)>:
> > > > You don't really state explicitly what the problem is.
> > > >
> > > > As was said, different browsers handle session creation
> differently: a
> > > > new window does *not* necessarily mean you get a new session.
> > > >
> > > > Dave
> > > >
> > > > --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
> > > >
> > > > > Hi All.
> > > > >
> > > > > I've a problem with session scope. The problem is:
> > > > >
> > > > > 1.- I open a web browser and make a login with user 1.
> > > > > 2.- I open a web browser and make a login with user 2.
> > > > >
> > > > > so, in the web browser 2, my user name is "1". I pressed
> CTRL+F5 and
> > > > > refresh with the correct name ("2").
> > > > >
> > > > > I've implemented SessionAware (with get and set) in my
> CommonAction
> > > > > (all other actions extends from it).
> > > > >
> > > > > To login a user and check that the user is logged, I use a
> > > > > LoginInterceptor.
> > > > >
> > > > > I've surfed the web and I didn't find a real solution.
> > > > >
> > > > > Regards,
> > > > >
> > > > > JP
> > > > >
> > > > > 2008/5/28, Milan Milanovic <milanmilanovich@(protected)>:
> > > > > > Should my action class implement SessionAware ?
> > > > > >
> > > > > > Milan Milanovic <milanmilanovich@(protected)
> Martin,
> > > > > >
> > > > > > thank you.
> > > > > >
> > > > > > My action package extends="struts-default", does this mean
> when I
> > > > > call
> > > > > > ActionContext.getContext().getSession() that I doesn't have
> access
> > > > > to session ?
> > > > > >
> > > > > > It seems to me that every creates a new session for my
> action
> > > > > class, and at least two methods doesn't have access to the
> same
> > > > > session. How can I manage to share my variable through
> multiple jsp
> > > > > pages for one action class using the users session ?
> > > > > >
> > > > > > --
> > > > > > Thx, Milan
> > > > > >
> > > > > > Martin wrote: Hello Milan-
> > > > > >
> > > > > > You can accomplish creation of HttpSession via
> > > > > CreateSessionInterceptor
> > > > > >
> > > > >
> > > >
>
http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/CreateSessionInterceptor.html
> > > > > >
> > > > > > (session parameters are available via a map which is is
> available
> > > > > via)
> > > > > > ActionContext.getContext().getSession()
> > > > > >
> > > > > > If you would be amenable to using a IOC container I would
> look at
> > > > > > implementing Springs SessionContextAutowiringInterceptor
> > > > > >
> > > > >
> > > >
>
http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/spring/interceptor/SessionContextAutowiringInterceptor.html
> > > > > >
> > > > > > HTH
> > > > > > Martin
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Milan Milanovic"
> > > > > > To: "Struts Users Mailing List"
> > > > > > Sent: Wednesday, May 28, 2008 11:08 AM
> > > > > > Subject: Re: [Struts 2] Session scope
> > > > > >
> > > > > >
> > > > > > > It seems that every request have its own scope ?!
> > > > > > >
> > > > > > > Milan Milanovic wrote: Hi,
> > > > > > >
> > > > > > > I have one action class and two pages. When first page is
> called,
> > > > > in its
> > > > > > > execute method I remove my session variable, like this:
> > > > > > >
> > > > > > >
> ServletActionContext.getContext().getSession().remove("fruits");
> > > > > > >
> > > > > > > and then when form from the first jsp page is submitted
> user
> > > > > enter details
> > > > > > > in the second form and there I save those changed to
> session,
> > > > > too:
> > > > > > >
> > > > > > >
> ServletActionContext.getContext().getSession().put("fruits",
> > > > > fruits);
> > > > > > >
> > > > > > > Of course, I first check if there is already fruits in
> session. I
> > > > > do this
> > > > > > > because some maybe want to go to first page to change
> something
> > > > > and then
> > > > > > > to go again to the second page to continue entering other
> info.
> > > > > But, when
> > > > > > > I exit both page an execute method is called (with above
> session
> > > > > remove
> > > > > > > method), and my second page is called fruits from session
> are
> > > > > read again -
> > > > > > > they are not removed ?
> > > > > > >
> > > > > > > --
> > > > > > > Thx in advance, Milan Milanovic
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > > For additional commands, e-mail: user-help@(protected)
> > > > >
> > > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > For additional commands, e-mail: user-help@(protected)
> > > >
> > > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186928.ezm (zipped)I didn't undesrtand your question. I use two users logged in through
two pc's. Then 1 user see the session of the other (the last legged
see the session of the first).
2008/5/28, Dave Newton <newton.dave@(protected)>:
> Why are all the session user variables different?
>
> I thought there were only two users logged in.
>
> Dave
>
> --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
>
> > The following are my logs (summary obviusly).
> >
> > 1.- The http session is the same, only change the Map of struts.
> > 2.- The Map used as session for struts2 is changing through the
> > invocations.
> > 3.- The first 2 are the login with the user "1". The next 2 are the
> > login with user "2". The next log is a operation with user "1" but it
> > keeps the session of user "2"!!!. The last is the CTRL+F5 in the
> > browser (in a separate PC) of user "1" and then, the http session is
> > right.
> >
> > Any idea?
> >
> > ...
> > INFO http-8182-1 org.gblx.action.common.CommonAction -
> > SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> > INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
> > {page=index.jsp, user=org.gblx.entities.User@(protected)}
> > ...
> > INFO http-8182-1 org.gblx.action.common.CommonAction -
> > SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> > INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
> > {LOGIN_ATTEMPT=yes, user=org.gblx.entities.User@(protected),
> > page=login.jsp}
> > ...
> > INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> > INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
> > {page=index.jsp, user=org.gblx.entities.User@(protected)}
> > ...
> > INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> > INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
> > {user=org.gblx.entities.User@(protected),
> > page=login.jsp}
> > ...
> > INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> > INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
> > {user=org.gblx.entities.User@(protected),
> > req=org.gblx.entities.Request@(protected)}
> > ...
> > INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> > INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
> > {page=menu.jsp, user=org.gblx.entities.User@(protected)}
> > ...
> >
> >
> > 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> > > I'm confused. I implemented SessionAware like:
> > >
> > > public class CommonAction extends ActionSupport implements
> > SessionAware {
> > >
> > > private static final long serialVersionUID = 1L;
> > >
> > > private static Logger logger =
> > Logger.getLogger(CommonAction.class);
> > >
> > > private Map session;
> > >
> > > public void setSession(Map session) {
> > > logger.info("SET_SESSION: " + session);
> > > this.session = session;
> > > }
> > >
> > > public Map getSession() {
> > > logger.info("GET_SESSION: " + session);
> > > return session;
> > > }
> > >
> > > }
> > >
> > > And all classes extends from it.
> > >
> > > I use
> > ServletActionContext.getRequest().getSession().getAttribute(XXX);
> > > (or set), and when I started to use the session with SessionAware
> > > implementation, I started to use this.getSession().XXX in the
> > childs
> > > of CommonAction.
> > >
> > > is that correct?
> > >
> > > As Milan, I see a diferent id in every invocation (see
> > > logger.info("SET_SESSION..."); in CommonAction).
> > >
> > > Any suggestion/correction?
> > >
> > > I'm searching the log.. but for now, nothing new.
> > >
> > > JP
> > >
> > >
> > >
> > >
> > >
> > > 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> > > > But I opened in diferents pc.
> > > >
> > > > 2008/5/28, Dave Newton <newton.dave@(protected)>:
> > > > > You don't really state explicitly what the problem is.
> > > > >
> > > > > As was said, different browsers handle session creation
> > differently: a
> > > > > new window does *not* necessarily mean you get a new session.
> > > > >
> > > > > Dave
> > > > >
> > > > > --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
> > > > >
> > > > > > Hi All.
> > > > > >
> > > > > > I've a problem with session scope. The problem is:
> > > > > >
> > > > > > 1.- I open a web browser and make a login with user 1.
> > > > > > 2.- I open a web browser and make a login with user 2.
> > > > > >
> > > > > > so, in the web browser 2, my user name is "1". I pressed
> > CTRL+F5 and
> > > > > > refresh with the correct name ("2").
> > > > > >
> > > > > > I've implemented SessionAware (with get and set) in my
> > CommonAction
> > > > > > (all other actions extends from it).
> > > > > >
> > > > > > To login a user and check that the user is logged, I use a
> > > > > > LoginInterceptor.
> > > > > >
> > > > > > I've surfed the web and I didn't find a real solution.
> > > > > >
> > > > > > Regards,
> > > > > >
> > > > > > JP
> > > > > >
> > > > > > 2008/5/28, Milan Milanovic <milanmilanovich@(protected)>:
> > > > > > > Should my action class implement SessionAware ?
> > > > > > >
> > > > > > > Milan Milanovic <milanmilanovich@(protected)
> > Martin,
> > > > > > >
> > > > > > > thank you.
> > > > > > >
> > > > > > > My action package extends="struts-default", does this mean
> > when I
> > > > > > call
> > > > > > > ActionContext.getContext().getSession() that I doesn't have
> > access
> > > > > > to session ?
> > > > > > >
> > > > > > > It seems to me that every creates a new session for my
> > action
> > > > > > class, and at least two methods doesn't have access to the
> > same
> > > > > > session. How can I manage to share my variable through
> > multiple jsp
> > > > > > pages for one action class using the users session ?
> > > > > > >
> > > > > > > --
> > > > > > > Thx, Milan
> > > > > > >
> > > > > > > Martin wrote: Hello Milan-
> > > > > > >
> > > > > > > You can accomplish creation of HttpSession via
> > > > > > CreateSessionInterceptor
> > > > > > >
> > > > > >
> > > > >
> >
> http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/CreateSessionInterceptor.html
> > > > > > >
> > > > > > > (session parameters are available via a map which is is
> > available
> > > > > > via)
> > > > > > > ActionContext.getContext().getSession()
> > > > > > >
> > > > > > > If you would be amenable to using a IOC container I would
> > look at
> > > > > > > implementing Springs SessionContextAutowiringInterceptor
> > > > > > >
> > > > > >
> > > > >
> >
> http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/spring/interceptor/SessionContextAutowiringInterceptor.html
> > > > > > >
> > > > > > > HTH
> > > > > > > Martin
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Milan Milanovic"
> > > > > > > To: "Struts Users Mailing List"
> > > > > > > Sent: Wednesday, May 28, 2008 11:08 AM
> > > > > > > Subject: Re: [Struts 2] Session scope
> > > > > > >
> > > > > > >
> > > > > > > > It seems that every request have its own scope ?!
> > > > > > > >
> > > > > > > > Milan Milanovic wrote: Hi,
> > > > > > > >
> > > > > > > > I have one action class and two pages. When first page is
> > called,
> > > > > > in its
> > > > > > > > execute method I remove my session variable, like this:
> > > > > > > >
> > > > > > > >
> > ServletActionContext.getContext().getSession().remove("fruits");
> > > > > > > >
> > > > > > > > and then when form from the first jsp page is submitted
> > user
> > > > > > enter details
> > > > > > > > in the second form and there I save those changed to
> > session,
> > > > > > too:
> > > > > > > >
> > > > > > > >
> > ServletActionContext.getContext().getSession().put("fruits",
> > > > > > fruits);
> > > > > > > >
> > > > > > > > Of course, I first check if there is already fruits in
> > session. I
> > > > > > do this
> > > > > > > > because some maybe want to go to first page to change
> > something
> > > > > > and then
> > > > > > > > to go again to the second page to continue entering other
> > info.
> > > > > > But, when
> > > > > > > > I exit both page an execute method is called (with above
> > session
> > > > > > remove
> > > > > > > > method), and my second page is called fruits from session
> > are
> > > > > > read again -
> > > > > > > > they are not removed ?
> > > > > > > >
> > > > > > > > --
> > > > > > > > Thx in advance, Milan Milanovic
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > > > For additional commands, e-mail: user-help@(protected)
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > > For additional commands, e-mail: user-help@(protected)
> > > > >
> > > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186929.ezm (zipped)Dave's question was: why, if there are only two users involved, does
each request log a different user instance?
>>> INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
>>> INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {LOGIN_ATTEMPT=yes, user=org.gblx.entities.User@(protected),
>>> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
>>> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {user=org.gblx.entities.User@(protected),
>>> page=login.jsp}
>>> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {user=org.gblx.entities.User@(protected),
>>> req=org.gblx.entities.Request@(protected)}
>>> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
Each request appears to have a different user.
L.
Juan Pablo Pizarro wrote:
> I didn't undesrtand your question. I use two users logged in through
> two pc's. Then 1 user see the session of the other (the last legged
> see the session of the first).
>
>
>
> 2008/5/28, Dave Newton <newton.dave@(protected)>:
>> Why are all the session user variables different?
>>
>> I thought there were only two users logged in.
>>
>> Dave
>>
>> --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
>>
>>> The following are my logs (summary obviusly).
>>>
>>> 1.- The http session is the same, only change the Map of struts.
>>> 2.- The Map used as session for struts2 is changing through the
>>> invocations.
>>> 3.- The first 2 are the login with the user "1". The next 2 are the
>>> login with user "2". The next log is a operation with user "1" but it
>>> keeps the session of user "2"!!!. The last is the CTRL+F5 in the
>>> browser (in a separate PC) of user "1" and then, the http session is
>>> right.
>>>
>>> Any idea?
>>>
>>> ...
>>> INFO http-8182-1 org.gblx.action.common.CommonAction -
>>> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
>>> INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
>>> ...
>>> INFO http-8182-1 org.gblx.action.common.CommonAction -
>>> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
>>> INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {LOGIN_ATTEMPT=yes, user=org.gblx.entities.User@(protected),
>>> page=login.jsp}
>>> ...
>>> INFO http-8182-2 org.gblx.action.common.CommonAction -
>>> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
>>> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
>>> ...
>>> INFO http-8182-2 org.gblx.action.common.CommonAction -
>>> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
>>> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {user=org.gblx.entities.User@(protected),
>>> page=login.jsp}
>>> ...
>>> INFO http-8182-2 org.gblx.action.common.CommonAction -
>>> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
>>> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {user=org.gblx.entities.User@(protected),
>>> req=org.gblx.entities.Request@(protected)}
>>> ...
>>> INFO http-8182-2 org.gblx.action.common.CommonAction -
>>> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
>>> INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
>>> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
>>> ...
>>>
>>>
>>> 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
>>>> I'm confused. I implemented SessionAware like:
>>>>
>>>> public class CommonAction extends ActionSupport implements
>>> SessionAware {
>>>> private static final long serialVersionUID = 1L;
>>>>
>>>> private static Logger logger =
>>> Logger.getLogger(CommonAction.class);
>>>> private Map session;
>>>>
>>>> public void setSession(Map session) {
>>>> logger.info("SET_SESSION: " + session);
>>>> this.session = session;
>>>> }
>>>>
>>>> public Map getSession() {
>>>> logger.info("GET_SESSION: " + session);
>>>> return session;
>>>> }
>>>>
>>>> }
>>>>
>>>> And all classes extends from it.
>>>>
>>>> I use
>>> ServletActionContext.getRequest().getSession().getAttribute(XXX);
>>>> (or set), and when I started to use the session with SessionAware
>>>> implementation, I started to use this.getSession().XXX in the
>>> childs
>>>> of CommonAction.
>>>>
>>>> is that correct?
>>>>
>>>> As Milan, I see a diferent id in every invocation (see
>>>> logger.info("SET_SESSION..."); in CommonAction).
>>>>
>>>> Any suggestion/correction?
>>>>
>>>> I'm searching the log.. but for now, nothing new.
>>>>
>>>> JP
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
>>>>> But I opened in diferents pc.
>>>>>
>>>>> 2008/5/28, Dave Newton <newton.dave@(protected)>:
>>>>>> You don't really state explicitly what the problem is.
>>>>>>
>>>>>> As was said, different browsers handle session creation
>>> differently: a
>>>>>> new window does *not* necessarily mean you get a new session.
>>>>>>
>>>>>> Dave
>>>>>>
>>>>>> --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
>>>>>>
>>>>>>> Hi All.
>>>>>>>
>>>>>>> I've a problem with session scope. The problem is:
>>>>>>>
>>>>>>> 1.- I open a web browser and make a login with user 1.
>>>>>>> 2.- I open a web browser and make a login with user 2.
>>>>>>>
>>>>>>> so, in the web browser 2, my user name is "1". I pressed
>>> CTRL+F5 and
>>>>>>> refresh with the correct name ("2").
>>>>>>>
>>>>>>> I've implemented SessionAware (with get and set) in my
>>> CommonAction
>>>>>>> (all other actions extends from it).
>>>>>>>
>>>>>>> To login a user and check that the user is logged, I use a
>>>>>>> LoginInterceptor.
>>>>>>>
>>>>>>> I've surfed the web and I didn't find a real solution.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> JP
>>>>>>>
>>>>>>> 2008/5/28, Milan Milanovic <milanmilanovich@(protected)>:
>>>>>>>> Should my action class implement SessionAware ?
>>>>>>>>
>>>>>>>> Milan Milanovic <milanmilanovich@(protected)
>>> Martin,
>>>>>>>> thank you.
>>>>>>>>
>>>>>>>> My action package extends="struts-default", does this mean
>>> when I
>>>>>>> call
>>>>>>>> ActionContext.getContext().getSession() that I doesn't have
>>> access
>>>>>>> to session ?
>>>>>>>> It seems to me that every creates a new session for my
>>> action
>>>>>>> class, and at least two methods doesn't have access to the
>>> same
>>>>>>> session. How can I manage to share my variable through
>>> multiple jsp
>>>>>>> pages for one action class using the users session ?
>>>>>>>> --
>>>>>>>> Thx, Milan
>>>>>>>>
>>>>>>>> Martin wrote: Hello Milan-
>>>>>>>>
>>>>>>>> You can accomplish creation of HttpSession via
>>>>>>> CreateSessionInterceptor
>> http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/CreateSessionInterceptor.html
>>>>>>>> (session parameters are available via a map which is is
>>> available
>>>>>>> via)
>>>>>>>> ActionContext.getContext().getSession()
>>>>>>>>
>>>>>>>> If you would be amenable to using a IOC container I would
>>> look at
>>>>>>>> implementing Springs SessionContextAutowiringInterceptor
>>>>>>>>
>> http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/spring/interceptor/SessionContextAutowiringInterceptor.html
>>>>>>>> HTH
>>>>>>>> Martin
>>>>>>>>
>>>>>>>> ----- Original Message -----
>>>>>>>> From: "Milan Milanovic"
>>>>>>>> To: "Struts Users Mailing List"
>>>>>>>> Sent: Wednesday, May 28, 2008 11:08 AM
>>>>>>>> Subject: Re: [Struts 2] Session scope
>>>>>>>>
>>>>>>>>
>>>>>>>>> It seems that every request have its own scope ?!
>>>>>>>>>
>>>>>>>>> Milan Milanovic wrote: Hi,
>>>>>>>>>
>>>>>>>>> I have one action class and two pages. When first page is
>>> called,
>>>>>>> in its
>>>>>>>>> execute method I remove my session variable, like this:
>>>>>>>>>
>>>>>>>>>
>>> ServletActionContext.getContext().getSession().remove("fruits");
>>>>>>>>> and then when form from the first jsp page is submitted
>>> user
>>>>>>> enter details
>>>>>>>>> in the second form and there I save those changed to
>>> session,
>>>>>>> too:
>>>>>>>>>
>>> ServletActionContext.getContext().getSession().put("fruits",
>>>>>>> fruits);
>>>>>>>>> Of course, I first check if there is already fruits in
>>> session. I
>>>>>>> do this
>>>>>>>>> because some maybe want to go to first page to change
>>> something
>>>>>>> and then
>>>>>>>>> to go again to the second page to continue entering other
>>> info.
>>>>>>> But, when
>>>>>>>>> I exit both page an execute method is called (with above
>>> session
>>>>>>> remove
>>>>>>>>> method), and my second page is called fruits from session
>>> are
>>>>>>> read again -
>>>>>>>>> they are not removed ?
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Thx in advance, Milan Milanovic
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>>
>>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>

Attachment:
user_186931.ezm (zipped)
So you have a 2 page wizard and you want to save the first page of
information in the session so the user can keep those values and edit the
2nd page before committing all of the information to the database, right?
I am trying to understand some of what you are describing:
* When you say "when I exit both page an execute method is called", what do
you mean by exit? The user clicks a link on page 1 or page 2 that leaves
the wizard? These links point to a central action that wipes the session
and then moves on to another page? Define the "exit" process please.
* The next part of that sentence says, "and my second page is called fruits
from session are read again". You mean that the user returns to the wizard
from somewhere else and goes directly to the 2nd page, without visiting Page
1 first and clicking Next/Save/Whatever?
Milan Milanovic wrote:
>
> Hi,
>
> I have one action class and two pages. When first page is called, in its
> execute method I remove my session variable, like this:
>
> ServletActionContext.getContext().getSession().remove("fruits");
>
> and then when form from the first jsp page is submitted user enter details
> in the second form and there I save those changed to session, too:
>
> ServletActionContext.getContext().getSession().put("fruits", fruits);
>
> Of course, I first check if there is already fruits in session. I do this
> because some maybe want to go to first page to change something and then
> to go again to the second page to continue entering other info. But, when
> I exit both page an execute method is called (with above session remove
> method), and my second page is called fruits from session are read again -
> they are not removed ?
>
> --
> Thx in advance, Milan Milanovic
>
>
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_186932.ezm (zipped)--- Laurie Harper <laurie@(protected):
> Dave's question was: why, if there are only two users involved,
> does each request log a different user instance?
That was it :)
But I was on the train, on my cel, and am, by nature, feck-deficient.
Dave
>
> >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
>
> >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {LOGIN_ATTEMPT=yes, user=org.gblx.entities.User@(protected),
>
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
>
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {user=org.gblx.entities.User@(protected),
> >>> page=login.jsp}
>
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {user=org.gblx.entities.User@(protected),
> >>> req=org.gblx.entities.Request@(protected)}
>
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
>
> Each request appears to have a different user.
>
> L.
>
> Juan Pablo Pizarro wrote:
> > I didn't undesrtand your question. I use two users logged in
> through
> > two pc's. Then 1 user see the session of the other (the last legged
> > see the session of the first).
> >
> >
> >
> > 2008/5/28, Dave Newton <newton.dave@(protected)>:
> >> Why are all the session user variables different?
> >>
> >> I thought there were only two users logged in.
> >>
> >> Dave
> >>
> >> --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
> >>
> >>> The following are my logs (summary obviusly).
> >>>
> >>> 1.- The http session is the same, only change the Map of struts.
> >>> 2.- The Map used as session for struts2 is changing through the
> >>> invocations.
> >>> 3.- The first 2 are the login with the user "1". The next 2 are
> the
> >>> login with user "2". The next log is a operation with user "1"
> but it
> >>> keeps the session of user "2"!!!. The last is the CTRL+F5 in the
> >>> browser (in a separate PC) of user "1" and then, the http session
> is
> >>> right.
> >>>
> >>> Any idea?
> >>>
> >>> ...
> >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> >>> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
> >>> ...
> >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> >>> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {LOGIN_ATTEMPT=yes, user=org.gblx.entities.User@(protected),
> >>> page=login.jsp}
> >>> ...
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> >>> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
> >>> ...
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> >>> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {user=org.gblx.entities.User@(protected),
> >>> page=login.jsp}
> >>> ...
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> >>> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {user=org.gblx.entities.User@(protected),
> >>> req=org.gblx.entities.Request@(protected)}
> >>> ...
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> >>> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> SET_SESSION:
> >>> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
> >>> ...
> >>>
> >>>
> >>> 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> >>>> I'm confused. I implemented SessionAware like:
> >>>>
> >>>> public class CommonAction extends ActionSupport implements
> >>> SessionAware {
> >>>> private static final long serialVersionUID = 1L;
> >>>>
> >>>> private static Logger logger =
> >>> Logger.getLogger(CommonAction.class);
> >>>> private Map session;
> >>>>
> >>>> public void setSession(Map session) {
> >>>> logger.info("SET_SESSION: " + session);
> >>>> this.session = session;
> >>>> }
> >>>>
> >>>> public Map getSession() {
> >>>> logger.info("GET_SESSION: " + session);
> >>>> return session;
> >>>> }
> >>>>
> >>>> }
> >>>>
> >>>> And all classes extends from it.
> >>>>
> >>>> I use
> >>> ServletActionContext.getRequest().getSession().getAttribute(XXX);
> >>>> (or set), and when I started to use the session with
> SessionAware
> >>>> implementation, I started to use this.getSession().XXX in the
> >>> childs
> >>>> of CommonAction.
> >>>>
> >>>> is that correct?
> >>>>
> >>>> As Milan, I see a diferent id in every invocation (see
> >>>> logger.info("SET_SESSION..."); in CommonAction).
> >>>>
> >>>> Any suggestion/correction?
> >>>>
> >>>> I'm searching the log.. but for now, nothing new.
> >>>>
> >>>> JP
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> >>>>> But I opened in diferents pc.
> >>>>>
> >>>>> 2008/5/28, Dave Newton <newton.dave@(protected)>:
> >>>>>> You don't really state explicitly what the problem is.
> >>>>>>
> >>>>>> As was said, different browsers handle session creation
> >>> differently: a
> >>>>>> new window does *not* necessarily mean you get a new session.
> >>>>>>
> >>>>>> Dave
> >>>>>>
> >>>>>> --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
> >>>>>>
> >>>>>>> Hi All.
> >>>>>>>
> >>>>>>> I've a problem with session scope. The problem is:
> >>>>>>>
> >>>>>>> 1.- I open a web browser and make a login with user 1.
> >>>>>>> 2.- I open a web browser and make a login with user 2.
> >>>>>>>
> >>>>>>> so, in the web browser 2, my user name is "1". I pressed
> >>> CTRL+F5 and
> >>>>>>> refresh with the correct name ("2").
> >>>>>>>
> >>>>>>> I've implemented SessionAware (with get and set) in my
> >>> CommonAction
> >>>>>>> (all other actions extends from it).
> >>>>>>>
> >>>>>>> To login a user and check that the user is logged, I use a
> >>>>>>> LoginInterceptor.
> >>>>>>>
> >>>>>>> I've surfed the web and I didn't find a real solution.
> >>>>>>>
> >>>>>>> Regards,
> >>>>>>>
> >>>>>>> JP
> >>>>>>>
> >>>>>>> 2008/5/28, Milan Milanovic <milanmilanovich@(protected)>:
> >>>>>>>> Should my action class implement SessionAware ?
> >>>>>>>>
> >>>>>>>> Milan Milanovic <milanmilanovich@(protected)
> >>> Martin,
> >>>>>>>> thank you.
> >>>>>>>>
> >>>>>>>> My action package extends="struts-default", does this mean
> >>> when I
> >>>>>>> call
> >>>>>>>> ActionContext.getContext().getSession() that I doesn't have
> >>> access
> >>>>>>> to session ?
> >>>>>>>> It seems to me that every creates a new session for my
> >>> action
> >>>>>>> class, and at least two methods doesn't have access to the
> >>> same
> >>>>>>> session. How can I manage to share my variable through
> >>> multiple jsp
> >>>>>>> pages for one action class using the users session ?
> >>>>>>>> --
> >>>>>>>> Thx, Milan
> >>>>>>>>
> >>>>>>>> Martin wrote: Hello Milan-
> >>>>>>>>
> >>>>>>>> You can accomplish creation of HttpSession via
> >>>>>>> CreateSessionInterceptor
> >>
>
http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/CreateSessionInterceptor.html
> >>>>>>>> (session parameters are available via a map which is is
> >>> available
> >>>>>>> via)
> >>>>>>>> ActionContext.getContext().getSession()
> >>>>>>>>
> >>>>>>>> If you would be amenable to using a IOC container I would
> >>> look at
> >>>>>>>> implementing Springs SessionContextAutowiringInterceptor
> >>>>>>>>
> >>
>
http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/spring/interceptor/SessionContextAutowiringInterceptor.html
> >>>>>>>> HTH
> >>>>>>>> Martin
> >>>>>>>>
> >>>>>>>> ----- Original Message -----
> >>>>>>>> From: "Milan Milanovic"
> >>>>>>>> To: "Struts Users Mailing List"
> >>>>>>>> Sent: Wednesday, May 28, 2008 11:08 AM
> >>>>>>>> Subject: Re: [Struts 2] Session scope
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>> It seems that every request have its own scope ?!
> >>>>>>>>>
> >>>>>>>>> Milan Milanovic wrote: Hi,
> >>>>>>>>>
> >>>>>>>>> I have one action class and two pages. When first page is
> >>> called,
> >>>>>>> in its
> >>>>>>>>> execute method I remove my session variable, like this:
> >>>>>>>>>
> >>>>>>>>>
> >>> ServletActionContext.getContext().getSession().remove("fruits");
> >>>>>>>>> and then when form from the first jsp page is submitted
> >>> user
> >>>>>>> enter details
> >>>>>>>>> in the second form and there I save those changed to
> >>> session,
> >>>>>>> too:
> >>>>>>>>>
> >>> ServletActionContext.getContext().getSession().put("fruits",
> >>>>>>> fruits);
> >>>>>>>>> Of course, I first check if there is already fruits in
> >>> session. I
> >>>>>>> do this
> >>>>>>>>> because some maybe want to go to first page to change
> >>> something
> >>>>>>> and then
> >>>>>>>>> to go again to the second page to continue entering other
> >>> info.
> >>>>>>> But, when
> >>>>>>>>> I exit both page an execute method is called (with above
> >>> session
> >>>>>>> remove
> >>>>>>>>> method), and my second page is called fruits from session
> >>> are
> >>>>>>> read again -
> >>>>>>>>> they are not removed ?
> >>>>>>>>>
> >>>>>>>>> --
> >>>>>>>>> Thx in advance, Milan Milanovic
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>
> ---------------------------------------------------------------------
> >>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >>>>>>> For additional commands, e-mail: user-help@(protected)
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >>>>>> For additional commands, e-mail: user-help@(protected)
> >>>>>>
> >>>>>>
> >>>
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >>> For additional commands, e-mail: user-help@(protected)
> >>>
> >>>
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> For additional commands, e-mail: user-help@(protected)
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186916.ezm (zipped)I figured out why the picker control is so small. It seems that the
control is picking up the font size from the CSS for the body. I cannot
seem to figure out how to set the size in the control. Does any one
happen to know?
Thanks,
Ken
-----Original Message-----
From: Hoying, Ken [mailto:Ken_Hoying@(protected)]
Sent: Wednesday, May 28, 2008 2:16 PM
To: user@(protected)
Subject: [S2] Datetimepicker Formatting Questions
I am having trouble determining how I can control the size of the
Datetimepicker elements.
The picker control is currently very small and difficult to read and
use. I have not been able to determine how to control its size. I saw a
few other similar questions in the list. Hwoever, none of them were
answered.
I would also like to make the text box where the selected value is
displayed a smaller font.
Any help would be greatly appreciated.
Thanks,
Ken

Attachment:
user_186919.ezm (zipped)I have not been able to determine how to set the size of the input box.
However more importantly, I was able to determine how to set the size of
the picker control. I added the following to my CSS:
div.datePickerContainer {
font-size: 12pt;
}
-----Original Message-----
From: Hoying, Ken [mailto:Ken_Hoying@(protected)]
Sent: Wednesday, May 28, 2008 2:47 PM
To: Struts Users Mailing List
Subject: RE: [S2] Datetimepicker Formatting Questions
I figured out why the picker control is so small. It seems that the
control is picking up the font size from the CSS for the body. I cannot
seem to figure out how to set the size in the control. Does any one
happen to know?
Thanks,
Ken
-----Original Message-----
From: Hoying, Ken [mailto:Ken_Hoying@(protected)]
Sent: Wednesday, May 28, 2008 2:16 PM
To: user@(protected)
Subject: [S2] Datetimepicker Formatting Questions
I am having trouble determining how I can control the size of the
Datetimepicker elements.
The picker control is currently very small and difficult to read and
use. I have not been able to determine how to control its size. I saw a
few other similar questions in the list. Hwoever, none of them were
answered.
I would also like to make the text box where the selected value is
displayed a smaller font.
Any help would be greatly appreciated.
Thanks,
Ken
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_186922.ezm (zipped)You are right, but I used the "wrong" way to obtain objects from a
session and it works. I'm reading a few posts about that.
Thanks.
Regards,
JP
2008/5/28, Hoying, Ken <Ken_Hoying@(protected)>:
> I have not been able to determine how to set the size of the input box.
> However more importantly, I was able to determine how to set the size of
> the picker control. I added the following to my CSS:
>
> div.datePickerContainer {
> font-size: 12pt;
> }
>
> -----Original Message-----
> From: Hoying, Ken [mailto:Ken_Hoying@(protected)]
> Sent: Wednesday, May 28, 2008 2:47 PM
> To: Struts Users Mailing List
> Subject: RE: [S2] Datetimepicker Formatting Questions
>
> I figured out why the picker control is so small. It seems that the
> control is picking up the font size from the CSS for the body. I cannot
> seem to figure out how to set the size in the control. Does any one
> happen to know?
>
> Thanks,
> Ken
>
> -----Original Message-----
> From: Hoying, Ken [mailto:Ken_Hoying@(protected)]
> Sent: Wednesday, May 28, 2008 2:16 PM
> To: user@(protected)
> Subject: [S2] Datetimepicker Formatting Questions
>
> I am having trouble determining how I can control the size of the
> Datetimepicker elements.
>
> The picker control is currently very small and difficult to read and
> use. I have not been able to determine how to control its size. I saw a
> few other similar questions in the list. Hwoever, none of them were
> answered.
>
> I would also like to make the text box where the selected value is
> displayed a smaller font.
>
> Any help would be greatly appreciated.
>
> Thanks,
> Ken
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186917.ezm (zipped)I find this very odd but essentially I want to test something against
the request parameter
So I put ?location=abc in the url
And when I print to the page via
<s:property value="%{#parameters.location}">
Its prints out abc
But if I try and test against it value via
<s:if test="%{#parameters.location == 'abc'}">
Or
<s:if test='%{#parameters.location.compareTo("abc") == 0}'>
Both return false
Any ideas on why its exhibiting this behavior?

Attachment:
user_186918.ezm (zipped)Try with something like this:
<s:if test="#session['parameters'].location.equals('abc')">
Regards,
JP
2008/5/28, Mark Lester <MarkL@(protected)>:
> I find this very odd but essentially I want to test something against
> the request parameter
>
> So I put ?location=abc in the url
>
> And when I print to the page via
>
> <s:property value="%{#parameters.location}">
>
> Its prints out abc
>
> But if I try and test against it value via
>
> <s:if test="%{#parameters.location == 'abc'}">
>
> Or
>
> <s:if test='%{#parameters.location.compareTo("abc") == 0}'>
>
> Both return false
>
> Any ideas on why its exhibiting this behavior?
>
>

Attachment:
user_186920.ezm (zipped)Nah that didn't work but I found the page that explains what the
problem is
http://struts.apache.org/2.x/docs/why-doesnt-the-if-tag-evaluate-test.
html
and that fixed it. The question is actually part of the FAQ but the
link to the solution is incorrect. It should be changed to the link
that I provided.
Regards,
Mark
-----Original Message-----
From: Juan Pablo Pizarro [mailto:juanpablo.pizarro@(protected)]
Sent: Wednesday, May 28, 2008 3:00 PM
To: Struts Users Mailing List
Subject: Re: s:if test request parameter variable problem
Try with something like this:
<s:if test="#session['parameters'].location.equals('abc')">
Regards,
JP
2008/5/28, Mark Lester <MarkL@(protected)>:
> I find this very odd but essentially I want to test something
against
> the request parameter
>
> So I put ?location=abc in the url
>
> And when I print to the page via
>
> <s:property value="%{#parameters.location}">
>
> Its prints out abc
>
> But if I try and test against it value via
>
> <s:if test="%{#parameters.location == 'abc'}">
>
> Or
>
> <s:if test='%{#parameters.location.compareTo("abc") == 0}'>
>
> Both return false
>
> Any ideas on why its exhibiting this behavior?
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_186925.ezm (zipped)Thanks for reporting. Fixed.
musachy
On Wed, May 28, 2008 at 3:09 PM, Mark Lester <MarkL@(protected):
> Nah that didn't work but I found the page that explains what the
> problem is
> http://struts.apache.org/2.x/docs/why-doesnt-the-if-tag-evaluate-test.
> html
> and that fixed it. The question is actually part of the FAQ but the
> link to the solution is incorrect. It should be changed to the link
> that I provided.
> Regards,
> Mark
>
> -----Original Message-----
> From: Juan Pablo Pizarro [mailto:juanpablo.pizarro@(protected)]
> Sent: Wednesday, May 28, 2008 3:00 PM
> To: Struts Users Mailing List
> Subject: Re: s:if test request parameter variable problem
>
> Try with something like this:
>
> <s:if test="#session['parameters'].location.equals('abc')">
>
> Regards,
>
> JP
>
> 2008/5/28, Mark Lester <MarkL@(protected)>:
>> I find this very odd but essentially I want to test something
> against
>> the request parameter
>>
>> So I put ?location=abc in the url
>>
>> And when I print to the page via
>>
>> <s:property value="%{#parameters.location}">
>>
>> Its prints out abc
>>
>> But if I try and test against it value via
>>
>> <s:if test="%{#parameters.location == 'abc'}">
>>
>> Or
>>
>> <s:if test='%{#parameters.location.compareTo("abc") == 0}'>
>>
>> Both return false
>>
>> Any ideas on why its exhibiting this behavior?
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_186923.ezm (zipped)I am using Struts 2.0.11 with dojo 0.4. This is the first Ajax enabled
application for our users. I use dojo.io.bind to submit most of the
requests. Is there a solution I can use to present some visual
indicator after submitting a request?
Many thanks for your help,
Jane

Attachment:
user_186924.ezm (zipped)thomas2004 wrote:
> Simply to say, I have a bean class looks as follow:
>
> public class Address{
> private street;
>
> public Address(){
> setStreet("Broadway");
> }
>
> public void setStreet(String street){
> this.street = street;
> }
>
> public String getStreet(){
> return this.street;
> }
> }
>
> Now in the "myaddress.jsp", I just want to show the address as one invoke
> this page, without clicking any submit button:
> ....
> <bean:write name="address" property="street" />
> ....
>
> How can I define the mappings in "struts-config.xml"?
To simply display the value, you just need to make an Address object
available in some scope, e.g. by calling request.setAttribute("address",
someAddress) in your action. That wont give you a form (with or without
a submit button), but will allow you to show the address. Is that
sufficient?
L.

Attachment:
user_186926.ezm (zipped)The problem:
I'm using two browsers into separate machines, so, I loged as "1" in
a browser and when a login with user "2" in other browser (and
separate machine), I see logged es "1", then I press ctrl+f5 and
change to user "2", but if I don't press that, the session is wrong.
The following are my logs.
...
INFO http-8182-1 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
{page=index.jsp, user=org.gblx.entities.User@(protected)}
...
INFO http-8182-1 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
INFO http-8182-1 org.gblx.action.common.CommonAction - SET_SESSION:
{LOGIN_ATTEMPT=yes, user=org.gblx.entities.User@(protected),
page=login.jsp}
...
INFO http-8182-2 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
{page=index.jsp, user=org.gblx.entities.User@(protected)}
...
INFO http-8182-2 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
{user=org.gblx.entities.User@(protected),
page=login.jsp}
...
INFO http-8182-2 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
{user=org.gblx.entities.User@(protected),
req=org.gblx.entities.Request@(protected)}
...
INFO http-8182-2 org.gblx.action.common.CommonAction -
SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
INFO http-8182-2 org.gblx.action.common.CommonAction - SET_SESSION:
{page=menu.jsp, user=org.gblx.entities.User@(protected)}
Steps:
1.- The first 2 are the login with the user "1".
2.- The next 2 are the login with user "2".
3.- The next log is a operation with user "1" but it keeps the
session of user "2"!!!.
4.- The last is the CTRL+F5 in the browser (in a separate PC) of user
"1" and then, the http session is right.
My hard:
- The project is running in a hp proliant 1100.
- 2 PC's 1 laptop. From thats, I open web browsers (IE6, FIREFOX).
Soft:
- tomcat 6.0.16 running on w2003 server.
- strts2 2.0.11.
- I use spring and hibernate to get domain objects, but not
integrated with struts in a conf.
Conf:
<interceptors>
<interceptor name="login"
class="org.gblx.interceptor.common.LoginInterceptor" />
<interceptor-stack name="defaultLoginStack">
<interceptor-ref name="servlet-config" />
<interceptor-ref name="params" />
<interceptor-ref name="login" />
<interceptor-ref name="prepare" />
<interceptor-ref name="chain" />
<interceptor-ref name="model-driven" />
<interceptor-ref name="fileUpload" />
<interceptor-ref name="static-params" />
<interceptor-ref name="params" />
<interceptor-ref name="conversionError" />
<interceptor-ref name="validation" />
<interceptor-ref name="workflow" />
</interceptor-stack>
<interceptor-stack name="defaultInsecureStack">
<interceptor-ref name="servlet-config" />
<interceptor-ref name="params" />
<interceptor-ref name="prepare" />
<interceptor-ref name="chain" />
<interceptor-ref name="model-driven" />
<interceptor-ref name="fileUpload" />
<interceptor-ref name="static-params" />
<interceptor-ref name="params" />
<interceptor-ref name="conversionError" />
<interceptor-ref name="validation" />
<interceptor-ref name="workflow" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="defaultLoginStack" />
Code:
I've a class called CommonAction. All Actions extends from it.
public class CommonAction extends ActionSupport implements SessionAware,
ParameterAware {
private static final long serialVersionUID = 1L;
private static Logger logger = Logger.getLogger(CommonAction.class);
private Map session;
private Map parameters;
public void setSession(Map session) {
HttpServletRequest request = (HttpServletRequest)
ActionContext.getContext().get(
org.apache.struts2.StrutsStatics.HTTP_REQUEST);
logger.info("SET_HTTP_SESSION: " + request.getSession().getId());
logger.info("SET_SESSION: " + session);
this.session = session;
}
public Map getSession() {
HttpServletRequest request = (HttpServletRequest)
ActionContext.getContext().get(
org.apache.struts2.StrutsStatics.HTTP_REQUEST);
logger.info("GET_HTTP_SESSION: " + request.getSession().getId());
logger.info("GET_SESSION: " + session);
return session;
}
public void setParameters(Map parameters) {
this.parameters = parameters;
}
public Map getParameters() {
return parameters;
}
}
I use two forms to modify the session. Through this.getSession() and using
ServletActionContext.getRequest().getSession().setAttribute("message",
getText("message_user_exists"));
I'm traied several things, but nothing. Any idea?
Regards,
JP

Attachment:
user_186930.ezm (zipped)Hi there,
I'm using the struts 2 xml validation. but when I send a form with for
example one empty textfield, the form shows up again and displays the
field error at the correct position. the problem is that all the other
fields which have had values before sending the form are empty now too.
how can I change that?
thanks in advance