You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Rodel T. Viado (JIRA)" <ji...@apache.org> on 2008/05/15 09:54:05 UTC

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

SlashesInActionNames does not work when namespace is the root context (i.e. namespace="/")
------------------------------------------------------------------------------------------

                 Key: WW-2648
                 URL: https://issues.apache.org/struts/browse/WW-2648
             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.


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

Posted by "Rodel T. Viado (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43852#action_43852 ] 

Rodel T. Viado commented on WW-2648:
------------------------------------

I made a link on the original issue, Don said that he was unable to reproduce the issue using a test case.  Unfortunately the test case did not cover this specific scenario, see my explanation below:



Your test case does not test if there exist a configured namespace whose value is "/, for example

        config = new DefaultConfiguration();

PackageConfig pkg = new PackageConfig("myRoot", "/", false, null);

        config.addPackageConfig("myRoot", pkg);
        configManager = new ConfigurationManager() {

            public Configuration getConfiguration() {

                return config;

            }

         };


       
      public void testGetMappingWithNamespaceSlash() throws Exception {



        req.setupGetRequestURI("/anythingHere/any/abc.action");

        req.setupGetServletPath("/anythingHere/any");

        req.setupGetAttribute(null);

        req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");



        mapper = new DefaultActionMapper();

        mapper.setSlashesInActionNames("true");

        mapping = mapper.getMapping(req, configManager);



       //Note that it is expected thet the namespace is "/" not ""
        assertEquals("/", mapping.getNamespace());

        assertEquals("anythingHere/any/abc", mapping.getName());

    } 

> SlashesInActionNames does not work when namespace is the root context (i.e. namespace="/")
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-2648
>                 URL: https://issues.apache.org/struts/browse/WW-2648
>             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.


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

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-2648:
--------------------------

    Fix Version/s: 2.1.3

> SlashesInActionNames does not work when namespace is the root context (i.e. namespace="/")
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-2648
>                 URL: https://issues.apache.org/struts/browse/WW-2648
>             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
>             Fix For: 2.1.3
>
>
> 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.


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

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown resolved WW-2648.
---------------------------

    Resolution: Fixed

Fixed, thanks for the more detailed reproduction information.

> SlashesInActionNames does not work when namespace is the root context (i.e. namespace="/")
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-2648
>                 URL: https://issues.apache.org/struts/browse/WW-2648
>             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
>             Fix For: 2.1.3
>
>
> 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.