[JIRA] Created: (APF-1157) can't use slashes in action name, they are always use for namespace

3 messages Options
Embed this post
Permalink
AppFuse - Issues mailing list

[JIRA] Created: (APF-1157) can't use slashes in action name, they are always use for namespace

Reply Threaded More More options
Print post
Permalink
can't use slashes in action name, they are always use for namespace
-------------------------------------------------------------------

                 Key: APF-1157
                 URL: http://issues.appfuse.org/browse/APF-1157
             Project: AppFuse
          Issue Type: Bug
         Environment: Struts2
            Reporter: Frédéric Pillonel
            Assignee: Matt Raible
            Priority: Trivial


Hey,

Bug described and solved from Jun 2007 here : http://www.mail-archive.com/users@.../msg05705.html

With Struts2, you can't use slashes in your action name even when <constant name="struts.enable.SlashesInActionNames" value="true"/> is defined by default with appfuse archetype (top of struts.xml). Anything before the last slash in your URL will be used for namespace.

Simply add <constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/> in struts.xml and everything will be OK.

With that line added, the following configuration and an URL like " http://localhost:8081/strutsTest-1.0-SNAPSHOT/gen/other/list.html " ...

Struts.xml config :
<package name="gen" extends="default" namespace="/gen">
    <action name="*/*" class="{1}Action" method="{2}">
    <result>/WEB-INF/pages/anything.jsp</result>
    </action>
</package>

... will get map to the action called 'otherAction' and its method 'list', as the .html is  my struts.action.extension, thus removed before wildcards are evaluated.

With the 'bug', struts was trying to map the url to a namespace of 'gen/other' instead of the expected 'gen', and an action name of 'list' instead of 'other/list'.

Is it possible to add <constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/> in struts.xml by default ?

Thanks,
Fred.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

AppFuse - Issues mailing list

[JIRA] Updated: (APF-1157) can't use slashes in action name, they are always use for namespace

Reply Threaded More More options
Print post
Permalink

     [ http://issues.appfuse.org/browse/APF-1157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Raible updated APF-1157:
-----------------------------

    Affects Version/s: 2.0.2
        Fix Version/s: 2.1
          Component/s: Web - Struts

Will fix in 2.1 - thanks for doing the research to figure out the solution.

> can't use slashes in action name, they are always use for namespace
> -------------------------------------------------------------------
>
>                 Key: APF-1157
>                 URL: http://issues.appfuse.org/browse/APF-1157
>             Project: AppFuse
>          Issue Type: Bug
>          Components: Web - Struts
>    Affects Versions: 2.0.2
>         Environment: Struts2
>            Reporter: Frédéric Pillonel
>            Assignee: Matt Raible
>            Priority: Trivial
>             Fix For: 2.1
>
>
> Hey,
> Bug described and solved from Jun 2007 here : http://www.mail-archive.com/users@.../msg05705.html
> With Struts2, you can't use slashes in your action name even when <constant name="struts.enable.SlashesInActionNames" value="true"/> is defined by default with appfuse archetype (top of struts.xml). Anything before the last slash in your URL will be used for namespace.
> Simply add <constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/> in struts.xml and everything will be OK.
> With that line added, the following configuration and an URL like " http://localhost:8081/strutsTest-1.0-SNAPSHOT/gen/other/list.html " ...
> Struts.xml config :
> <package name="gen" extends="default" namespace="/gen">
>     <action name="*/*" class="{1}Action" method="{2}">
>     <result>/WEB-INF/pages/anything.jsp</result>
>     </action>
> </package>
> ... will get map to the action called 'otherAction' and its method 'list', as the .html is  my struts.action.extension, thus removed before wildcards are evaluated.
> With the 'bug', struts was trying to map the url to a namespace of 'gen/other' instead of the expected 'gen', and an action name of 'list' instead of 'other/list'.
> Is it possible to add <constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/> in struts.xml by default ?
> Thanks,
> Fred.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

AppFuse - Issues mailing list

[JIRA] Updated: (APF-1157) can't use slashes in action name, they are always use for namespace

Reply Threaded More More options
Print post
Permalink
In reply to this post by AppFuse - Issues mailing list

     [ http://issues.appfuse.org/browse/APF-1157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Raible updated APF-1157:
-----------------------------

    Fix Version/s:     (was: 2.1.0-M1)
                   2.1.0-M2

> can't use slashes in action name, they are always use for namespace
> -------------------------------------------------------------------
>
>                 Key: APF-1157
>                 URL: http://issues.appfuse.org/browse/APF-1157
>             Project: AppFuse
>          Issue Type: Bug
>          Components: Web - Struts
>    Affects Versions: 2.0.2
>         Environment: Struts2
>            Reporter: Fr?d?ric Pillonel
>            Assignee: Matt Raible
>            Priority: Trivial
>             Fix For: 2.1.0-M2
>
>
> Hey,
> Bug described and solved from Jun 2007 here : http://www.mail-archive.com/users@.../msg05705.html
> With Struts2, you can't use slashes in your action name even when <constant name="struts.enable.SlashesInActionNames" value="true"/> is defined by default with appfuse archetype (top of struts.xml). Anything before the last slash in your URL will be used for namespace.
> Simply add <constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/> in struts.xml and everything will be OK.
> With that line added, the following configuration and an URL like " http://localhost:8081/strutsTest-1.0-SNAPSHOT/gen/other/list.html " ...
> Struts.xml config :
> <package name="gen" extends="default" namespace="/gen">
>     <action name="*/*" class="{1}Action" method="{2}">
>     <result>/WEB-INF/pages/anything.jsp</result>
>     </action>
> </package>
> ... will get map to the action called 'otherAction' and its method 'list', as the .html is  my struts.action.extension, thus removed before wildcards are evaluated.
> With the 'bug', struts was trying to map the url to a namespace of 'gen/other' instead of the expected 'gen', and an action name of 'list' instead of 'other/list'.
> Is it possible to add <constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/> in struts.xml by default ?
> Thanks,
> Fred.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]