You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Jason Pyeron (JIRA)" <ji...@apache.org> on 2011/06/05 01:26:47 UTC

[jira] [Created] (WW-3642) Blank Extensions documentation

Blank Extensions documentation
------------------------------

                 Key: WW-3642
                 URL: https://issues.apache.org/jira/browse/WW-3642
             Project: Struts 2
          Issue Type: Bug
          Components: Core Actions
    Affects Versions: 2.1.8.1
         Environment: Glassfish v3, Eclipse
            Reporter: Jason Pyeron
            Assignee: Maurizio Cucchiara
            Priority: Critical


Given the following configuration:

web.xml:
--------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="
http://java.sun.com/xml/ns/javaee" xmlns:web="
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
    <display-name>WebSite</display-name>

    <filter>
        <filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
        <init-param>
            <param-name>actionPackages</param-name>
            <param-value>com.example.actions</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

struts.xml:
--------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" >
<struts>
    <constant name="struts.devMode" value="true"/>
    <constant name="struts.action.extension" value=""/>

    <package name="default" extends="struts-default">
        <action name="home">
            <result>/home.jsp</result>
        </action>
    </package>

</struts>


In addition to these two xml files, I have two image files and two jsp
files:
    /logo.gif
    /images/logo.gif
    /index.jsp
    /home.jsp

The image files are unique so I know which is being displayed.  The JSP
files are unique so I know which is being displayed.  (ie "this is home" and
"this is index")


Results:
---------------------------------------------------------------------
I have gone to each of the specified URLs, with the following results:

/home
This works as expected.  I see a page that says "this is home"

/home.jsp
Error page with the message: There is no Action mapped for namespace / and
action name home.jsp

/index.jsp
Error page with the message: There is no Action mapped for namespace / and
action name index.jsp

/
Error page with the message: There is no Action mapped for namespace / and
action name index.jsp

/logo.gif
Error page with the message: There is no Action mapped for namespace / and
action name logo.gif

/images/logo.gif
Error page with the message: There is no Action mapped for action name
logo.gif


I believe this is not the intended result.  I would expect the same results
that I get if I set the extension to "action" (with the corresponding URLs)
These results are as follows:

/home.action
This works as expected.  I see a page that says "this is home"

/home
Error 404 (expected result)

/home.jsp
I see a page that says "this is home", but it is not the result of the
action (parameters in the action are not processed)

/index.jsp
This works as expected.  I see a page that says "this is index"

/
This works as expected.  I see a page that says "this is index"

/logo.gif
Works as expected, I see the logo image.

/images/logo.gif
Works as expected, I see the other logo image.


I consider this a bug, since the behavior is quite different between the two
scenarios.  Restating it again, I expect the same behavior when the
extension is blank as when it is "action" or "do" or "fred", except there is
no extension.  I also expect non-actions to be processed as normal.


Expected solution:

When an extension is specified, the actual action name is the concatenation
of the specified action name plus the extension.  For example:
"home.action".  Requests that don't match the "actual" action name, are
considered normal file requests.

When a blank extension is specified, the actual action name is exactly what
is specified in the action name, without the addition of the extension.  For
example: "home".  But other requests that don't match specified action names
would be considered normal file requests.  (BTW, with blank extensions the
action name may specify an extension, for example "home.do")



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (WW-3642) Blank Extensions documentation

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

Lukasz Lenart closed WW-3642.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 2.3

Solved, thanks for patch!

> Blank Extensions documentation
> ------------------------------
>
>                 Key: WW-3642
>                 URL: https://issues.apache.org/jira/browse/WW-3642
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>            Reporter: Jason Pyeron
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>             Fix For: 2.3
>
>         Attachments: WW-3454-docs.patch
>
>
> see invalid bug WW-3454

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WW-3642) Blank Extensions documentation

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

Jason Pyeron updated WW-3642:
-----------------------------

    Attachment: WW-3454-docs.patch

> Blank Extensions documentation
> ------------------------------
>
>                 Key: WW-3642
>                 URL: https://issues.apache.org/jira/browse/WW-3642
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>            Reporter: Jason Pyeron
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>         Attachments: WW-3454-docs.patch
>
>
> see invalid bug WW-3454

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3642) Blank Extensions documentation

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044492#comment-13044492 ] 

Hudson commented on WW-3642:
----------------------------

Integrated in Struts2 #311 (See [https://builds.apache.org/hudson/job/Struts2/311/])
    WW-3642 - Improves documentation about empty action's extension

lukaszlenart : 
Files : 
* /struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties


> Blank Extensions documentation
> ------------------------------
>
>                 Key: WW-3642
>                 URL: https://issues.apache.org/jira/browse/WW-3642
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>            Reporter: Jason Pyeron
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>             Fix For: 2.3
>
>         Attachments: WW-3454-docs.patch
>
>
> see invalid bug WW-3454

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WW-3642) Blank Extensions documentation

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

Jason Pyeron updated WW-3642:
-----------------------------

       Priority: Minor  (was: Critical)
    Description: 
see invalid bug WW-3454


  was:
Given the following configuration:

web.xml:
--------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="
http://java.sun.com/xml/ns/javaee" xmlns:web="
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
    <display-name>WebSite</display-name>

    <filter>
        <filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
        <init-param>
            <param-name>actionPackages</param-name>
            <param-value>com.example.actions</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

struts.xml:
--------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" >
<struts>
    <constant name="struts.devMode" value="true"/>
    <constant name="struts.action.extension" value=""/>

    <package name="default" extends="struts-default">
        <action name="home">
            <result>/home.jsp</result>
        </action>
    </package>

</struts>


In addition to these two xml files, I have two image files and two jsp
files:
    /logo.gif
    /images/logo.gif
    /index.jsp
    /home.jsp

The image files are unique so I know which is being displayed.  The JSP
files are unique so I know which is being displayed.  (ie "this is home" and
"this is index")


Results:
---------------------------------------------------------------------
I have gone to each of the specified URLs, with the following results:

/home
This works as expected.  I see a page that says "this is home"

/home.jsp
Error page with the message: There is no Action mapped for namespace / and
action name home.jsp

/index.jsp
Error page with the message: There is no Action mapped for namespace / and
action name index.jsp

/
Error page with the message: There is no Action mapped for namespace / and
action name index.jsp

/logo.gif
Error page with the message: There is no Action mapped for namespace / and
action name logo.gif

/images/logo.gif
Error page with the message: There is no Action mapped for action name
logo.gif


I believe this is not the intended result.  I would expect the same results
that I get if I set the extension to "action" (with the corresponding URLs)
These results are as follows:

/home.action
This works as expected.  I see a page that says "this is home"

/home
Error 404 (expected result)

/home.jsp
I see a page that says "this is home", but it is not the result of the
action (parameters in the action are not processed)

/index.jsp
This works as expected.  I see a page that says "this is index"

/
This works as expected.  I see a page that says "this is index"

/logo.gif
Works as expected, I see the logo image.

/images/logo.gif
Works as expected, I see the other logo image.


I consider this a bug, since the behavior is quite different between the two
scenarios.  Restating it again, I expect the same behavior when the
extension is blank as when it is "action" or "do" or "fred", except there is
no extension.  I also expect non-actions to be processed as normal.


Expected solution:

When an extension is specified, the actual action name is the concatenation
of the specified action name plus the extension.  For example:
"home.action".  Requests that don't match the "actual" action name, are
considered normal file requests.

When a blank extension is specified, the actual action name is exactly what
is specified in the action name, without the addition of the extension.  For
example: "home".  But other requests that don't match specified action names
would be considered normal file requests.  (BTW, with blank extensions the
action name may specify an extension, for example "home.do")



    Environment:     (was: Glassfish v3, Eclipse)

> Blank Extensions documentation
> ------------------------------
>
>                 Key: WW-3642
>                 URL: https://issues.apache.org/jira/browse/WW-3642
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>            Reporter: Jason Pyeron
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>         Attachments: WW-3454-docs.patch
>
>
> see invalid bug WW-3454

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WW-3642) Blank Extensions documentation

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

Jason Pyeron updated WW-3642:
-----------------------------

    Affects Version/s:     (was: 2.1.8.1)

> Blank Extensions documentation
> ------------------------------
>
>                 Key: WW-3642
>                 URL: https://issues.apache.org/jira/browse/WW-3642
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>            Reporter: Jason Pyeron
>            Assignee: Maurizio Cucchiara
>            Priority: Minor
>         Attachments: WW-3454-docs.patch
>
>
> see invalid bug WW-3454

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira