You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Gavin Harrison (JIRA)" <ji...@apache.org> on 2008/05/14 21:05:05 UTC

[jira] Commented: (WW-2461) SlashesInActionNames does not work when namespace is the root context (i.e. namespace="/")

    [ https://issues.apache.org/struts/browse/WW-2461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43846#action_43846 ] 

Gavin Harrison commented on WW-2461:
------------------------------------

I've had exactly the same issue.

This works:

	<package name="admin" namespace="/admin" extends="struts-default">	
      
        <action name="crud/*/*" method="{2}" class="uk.co.acme.website.web.actions.admin.{1}Action"> 
	    	<result name="success">/jsp/admin/{1}/{1}-{2}.jsp</result> 
	    	<result name="error">/jsp/admin/{1}/{1}-{2}.jsp</result>
	    	<result name="input">/jsp/admin/{1}/{1}-{2}.jsp</result>
	    	<result name="message">/jsp/admin/{1}/{1}-{2}-message.jsp</result>
	    	       
    </package>

but it wouldn't work in this root package:

  <package name="root" namespace="/" extends="struts-default">
  </package>

I got exactly the same error as the reporter.

> SlashesInActionNames does not work when namespace is the root context (i.e. namespace="/")
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-2461
>                 URL: https://issues.apache.org/struts/browse/WW-2461
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.0.11
>         Environment: OS- Fedora
> JDK jdk1.6.0_02 
> Servlet container - Tomcat 6.0.14
>            Reporter: Rodel T. Viado
>            Assignee: Don Brown
>
> Below is a sample config that exhibits the problem. Note that the namespace is the root context, it works fine if the namespace is not the root.
> <struts>
> <constant name="struts.enable.SlashesInActionNames" value="true" />
> <package name="login" namespace="/" extends="struts-default">
>       
>         <action name="sample/Login" class="com.any.LoginAction">
>             <result name="input">/login/login.jsp</result>
>             <result type="redirect-action">SucessAction</result>
>         </action>
> </package>
> </struts>
> Accessing http://localhost/<webAppContext>/sample/Login.action
> Where <webAppContext> is the contextPath of the web application
> Results in an error:
> There is no Action mapped for action name sample/Login. - [unknown location]
>         at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
>         at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
>         at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
>         at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.