S2 how to determine if a session exists from an Interceptor

2014-02-06 Thread Greg Lindholm
I have an Interceptor that wants to put something in the session after the action has executed. But if the session doesn't already exist I get an exception: java.lang.IllegalStateException: Cannot create a session after the response has been committed How can I determine if the session already

Re: S2 how to determine if a session exists from an Interceptor

2014-02-06 Thread Maurizio Cucchiara
Hi Greg, I seem to recall that this is not the best way to handle the session and generally speaking, it always better to abstract as much as possible http's details I could be wrong, but It would be better if your action implements a specific interface (SessionAware or HttpSessionAware) Twitter

Re: S2 how to determine if a session exists from an Interceptor

2014-02-06 Thread Ken McWilliams
The OP has abstracted away most of the details, he is working with MapString, Object! The session is not generally struts2s responsibility it, generally it is maintained by the web container. Tomcat/Glassfish, etc. And generally you would consider it in such an environment to always exist. What

Re: S2 how to determine if a session exists from an Interceptor

2014-02-06 Thread Greg Lindholm
My Interceptor is expecting a session to exist, but I'm occasionally getting exceptions that say the session doesn't exist, and since this occurs after the action has executed and response has been committed it is too late to create a session. So my question is; From with an Interceptor is there

Re: S2 how to determine if a session exists from an Interceptor

2014-02-06 Thread Dave Newton
There's the session interceptor. It's unusual that you'd execute an action and not have a session, though, since JSP pages will create their own if one doesn't exist and it (the JSP) isn't explicitly configured not to create one. On Thu, Feb 6, 2014 at 1:33 PM, Greg Lindholm

Re: S2 how to determine if a session exists from an Interceptor

2014-02-06 Thread Lukasz Lenart
http://struts.apache.org/release/2.3.x/docs/create-session-interceptor.html 2014-02-06 19:42 GMT+01:00 Dave Newton davelnew...@gmail.com: There's the session interceptor. It's unusual that you'd execute an action and not have a session, though, since JSP pages will create their own if one

Struts2 NameSpace Error.

2014-02-06 Thread Ramana
Hi, Please help on this issue.. I am learning Struts2 with simple class. I am using Struts2 2.3.16 on Java Runtime 1.6. I am getting the below Error. I tried different ways by looking into google and you tube.. i am getting the same problem. i am trying this issue for past couple of days but i

Re: Struts2 NameSpace Error.

2014-02-06 Thread Lukasz Lenart
2014-02-07 2:04 GMT+01:00 Ramana puram.ram...@gmail.com: INFO: Unable to locate configuration files of the name struts.xml, skipping Feb 6, 2014 8:01:27 PM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info Here you have the answer - your struts.xml wasn't properly