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'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>

Reply via email to