You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcin Orlinski <or...@poczta.fm> on 2007/04/27 09:59:15 UTC

[s2] web-container authorization problem

Hello all

I have simple application (struts2) that works on Tomcat 5.5 with
DataSourceRealm. In web.xml I have:

<login-config>
	<auth-method>FORM</auth-method>
	<realm-name>myRealm</realm-name>
	<form-login-config>
		<form-login-page>/logon.jsp</form-login-page>
		<form-error-page>/logon_error.jsp</form-error-page>
	</form-login-config>
</login-config>

and everything works fine. But when I try use this:

<form-login-page>/logon.do</form-login-page>
<form-error-page>/logon_error.do</form-error-page>

and I request the secured page (/myContext/admin/users.do), server response
is:

HTTP Status 404 - /myContext/logon.do

When I request page /myContext/logon.do, this page works without problem.
struts.xml:

<package name="logon" namespace="/" extends="struts-default">
	<action name="logon" class="example.SupportAction">
		<result>/logon.jsp</result>
	</action>
	<action name="logon_error" class="example.SupportAction">
		<result>/logon_error.jsp</result>
	</action>
</package>


logon.jsp and logon_error.jsp are a simple jsp without struts tags (but I
woud like use <s:text> tag).

Can you tell me what is wrong ?

Best regards
Marcin Orlinski
-- 
View this message in context: http://www.nabble.com/-s2--web-container-authorization-problem-tf3656226.html#a10214779
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [OT] [s2] web-container authorization problem

Posted by Laurie Harper <la...@holoweb.net>.
Which Servlet spec version are you targetting? I.e. what does the start 
of your web.xml look like? If I recall correctly, Servlet 2.4 clarifies 
the semantics for form-login-config elements to explicitly allow any 
type of resource to be referenced. Prior to that many containers, 
including Tomcat (again, if I recall correctly) would only allow JSPs to 
be referenced there.

If you're already working to Servlet 2.4 (or updating your web.xml so 
you are) doesn't fix the problem, the correct place to follow up would 
be the Tomcat Users list, since this isn't a Struts-specific issue.

L.

Marcin Orlinski wrote:
> Hello all
> 
> I have simple application (struts2) that works on Tomcat 5.5 with
> DataSourceRealm. In web.xml I have:
> 
> <login-config>
> 	<auth-method>FORM</auth-method>
> 	<realm-name>myRealm</realm-name>
> 	<form-login-config>
> 		<form-login-page>/logon.jsp</form-login-page>
> 		<form-error-page>/logon_error.jsp</form-error-page>
> 	</form-login-config>
> </login-config>
> 
> and everything works fine. But when I try use this:
> 
> <form-login-page>/logon.do</form-login-page>
> <form-error-page>/logon_error.do</form-error-page>
> 
> and I request the secured page (/myContext/admin/users.do), server response
> is:
> 
> HTTP Status 404 - /myContext/logon.do
> 
> When I request page /myContext/logon.do, this page works without problem.
> struts.xml:
> 
> <package name="logon" namespace="/" extends="struts-default">
> 	<action name="logon" class="example.SupportAction">
> 		<result>/logon.jsp</result>
> 	</action>
> 	<action name="logon_error" class="example.SupportAction">
> 		<result>/logon_error.jsp</result>
> 	</action>
> </package>
> 
> 
> logon.jsp and logon_error.jsp are a simple jsp without struts tags (but I
> woud like use <s:text> tag).
> 
> Can you tell me what is wrong ?
> 
> Best regards
> Marcin Orlinski


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