Re: can struts work with sessions disabled?

2002-11-07 Thread Brad Harding
Thanks Craig for your response. The problems I'm having do indeed seem to 
be related to the locale, but it seems like a lot of struts tags might rely 
on the locale being in the session.

For example, the bean:message tag seems to rely on a locale being in the 
session to work. I can probably live without the bean:message tag, but then 
I discovered the html:errors tag also seems to rely on a locale being in 
the session. Both of these problems trace back to the 
org.apache.struts.utils.RequestUtils class, which appears to use the 
session. Part of the stack trace is below.

Do you think I would need to subclass RequestUtils and override the method 
that uses the session, or is there some easier way to just get tags like 
bean:message and html:errors to work without sessions enabled?

Thanks,

Brad

stack trace:

Error 500
An error has occured while processing request: 
http://128.48.199.46/wip/checkreturnlogin.do (/wip/returnlogin.jsp)
Message: Server caught unhandled exception from servlet [action]: Server 
caught unhandled exception from servlet [jsp11]: can#39;t access 
SESSION_SCOPE without an HttpSession

Target Servlet: action
StackTrace:

Root Error-1: can't access SESSION_SCOPE without an HttpSession
java.lang.IllegalArgumentException: can't access SESSION_SCOPE without an 
HttpSession
 at 
org.apache.jasper.runtime.PageContextImpl.getAttribute(PageContextImpl.java:186) 

 at org.apache.struts.util.RequestUtils.present(RequestUtils.java:812)
 at 
org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:229)
 at _returnlogin_jsp_29._jspService(_returnlogin_jsp_29.java:188)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:127)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at 
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:390) 

 at 
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:712)
 at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:879)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)




At 09:20 AM 11/4/2002 -0800, you wrote:


On Mon, 4 Nov 2002, Brad Harding wrote:

 Date: Mon, 04 Nov 2002 09:17:10 -0800
 From: Brad Harding [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: can struts work with sessions disabled?

 Can a struts app work with sessions disabled on the application server?

As long as your app doesn't use sessions, this should be ok.

 If
 so, what do I need to change? Finally, why does struts use sessions (it's
 not obvious to me what struts does that is beyond the scope of a request)?


The only Struts feature that requires sessions is the saving of the user's
preferred locale.  Of course, you're allowed to use the session for form
beans as well.

 Background:

 I'm building a struts application that cannot depend on the application
 server session (the app will run on a cluster of app servers that don't
 share sessions). I've coded my app to only use the request context for
 beans etc., and to not use the session context at all. However, when I
 disable sessions on the application server, my app stops working (can't
 even get to the first login jsp, let alone the struts main servlet).


Without details (such as error messages from your log files), that's
pretty hard to debug.

 Thanks,

 Brad Harding


Craig


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org



--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: can struts work with sessions disabled?

2002-11-07 Thread du Plessis, Corneil C
You will have to allow struts to create the session and store locale
information.
Use a Cookie to manage or identify state information that your application
relies on.

-Original Message-
From: Brad Harding [mailto:bradharding;earthlink.net]
Sent: 08 November, 2002 02:46
To: Struts Users Mailing List
Subject: Re: can struts work with sessions disabled?


Thanks Craig for your response. The problems I'm having do indeed seem to 
be related to the locale, but it seems like a lot of struts tags might rely 
on the locale being in the session.

For example, the bean:message tag seems to rely on a locale being in the 
session to work. I can probably live without the bean:message tag, but then 
I discovered the html:errors tag also seems to rely on a locale being in 
the session. Both of these problems trace back to the 
org.apache.struts.utils.RequestUtils class, which appears to use the 
session. Part of the stack trace is below.

Do you think I would need to subclass RequestUtils and override the method 
that uses the session, or is there some easier way to just get tags like 
bean:message and html:errors to work without sessions enabled?

Thanks,

Brad

stack trace:

Error 500
An error has occured while processing request: 
http://128.48.199.46/wip/checkreturnlogin.do (/wip/returnlogin.jsp)
Message: Server caught unhandled exception from servlet [action]: Server 
caught unhandled exception from servlet [jsp11]: can#39;t access 
SESSION_SCOPE without an HttpSession

Target Servlet: action
StackTrace:


Root Error-1: can't access SESSION_SCOPE without an HttpSession
java.lang.IllegalArgumentException: can't access SESSION_SCOPE without an 
HttpSession
  at 
org.apache.jasper.runtime.PageContextImpl.getAttribute(PageContextImpl.java:
186) 

  at org.apache.struts.util.RequestUtils.present(RequestUtils.java:812)
  at 
org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:229)
  at _returnlogin_jsp_29._jspService(_returnlogin_jsp_29.java:188)
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:127)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at 
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va:390) 

  at 
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:712)
  at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:879)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)




At 09:20 AM 11/4/2002 -0800, you wrote:


On Mon, 4 Nov 2002, Brad Harding wrote:

  Date: Mon, 04 Nov 2002 09:17:10 -0800
  From: Brad Harding [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: can struts work with sessions disabled?
 
  Can a struts app work with sessions disabled on the application server?

As long as your app doesn't use sessions, this should be ok.

  If
  so, what do I need to change? Finally, why does struts use sessions
(it's
  not obvious to me what struts does that is beyond the scope of a
request)?
 

The only Struts feature that requires sessions is the saving of the user's
preferred locale.  Of course, you're allowed to use the session for form
beans as well.

  Background:
 
  I'm building a struts application that cannot depend on the application
  server session (the app will run on a cluster of app servers that don't
  share sessions). I've coded my app to only use the request context for
  beans etc., and to not use the session context at all. However, when I
  disable sessions on the application server, my app stops working (can't
  even get to the first login jsp, let alone the struts main servlet).
 

Without details (such as error messages from your log files), that's
pretty hard to debug.

  Thanks,
 
  Brad Harding
 

Craig


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

__

Disclaimer and confidentiality note


Everything in this e-mail and any attachments relating to the official business of 
Standard Bank Group Limited is proprietary to the company. It is confidential, legally 
privileged and protected by law. Standard Bank does not own and endorse any other 
content. 
Views and opinions are those of the sender unless clearly stated as being that of 
Standard Bank. 

The person addressed in the e-mail is the sole authorised recipient. Please notify the 
sender 
immediately if it has unintentionally reached you and do not read, disclose or use the 
content
in any way. 

Standard Bank can not assure that the integrity of this communication has been 
maintained nor 
that it is free of errors

Re: can struts work with sessions disabled?

2002-11-04 Thread Craig R. McClanahan


On Mon, 4 Nov 2002, Brad Harding wrote:

 Date: Mon, 04 Nov 2002 09:17:10 -0800
 From: Brad Harding [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: can struts work with sessions disabled?

 Can a struts app work with sessions disabled on the application server?

As long as your app doesn't use sessions, this should be ok.

 If
 so, what do I need to change? Finally, why does struts use sessions (it's
 not obvious to me what struts does that is beyond the scope of a request)?


The only Struts feature that requires sessions is the saving of the user's
preferred locale.  Of course, you're allowed to use the session for form
beans as well.

 Background:

 I'm building a struts application that cannot depend on the application
 server session (the app will run on a cluster of app servers that don't
 share sessions). I've coded my app to only use the request context for
 beans etc., and to not use the session context at all. However, when I
 disable sessions on the application server, my app stops working (can't
 even get to the first login jsp, let alone the struts main servlet).


Without details (such as error messages from your log files), that's
pretty hard to debug.

 Thanks,

 Brad Harding


Craig


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org