You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "haruhiko nishi (JIRA)" <ji...@apache.org> on 2012/11/21 05:53:57 UTC
[jira] [Created] (WW-3925) behavior of Index action found under
designated package is unclear
haruhiko nishi created WW-3925:
----------------------------------
Summary: behavior of Index action found under designated package is unclear
Key: WW-3925
URL: https://issues.apache.org/jira/browse/WW-3925
Project: Struts 2
Issue Type: Bug
Components: Plugin - Convention
Affects Versions: 2.3.4
Environment: JBoss 5.1
Windows 7 x64
Reporter: haruhiko nishi
Priority: Trivial
We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
<constant name="struts.action.extension" value=","/>
When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
However, if we provide /my_context/, we receive the following error:
HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
Currently, our convention-plugin settings are declared as follows:
<constant name="struts.convention.package.locators.basePackage" value="com.example"/>
<constant name="struts.convention.package.locators" value="action"/>
Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
om.example.common, in which the aforementioned Index file can be immediately found by narrowing the search scope, requesting /my_context/ displays the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
We appreciate your responses.
Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501789#comment-13501789 ]
Lukasz Lenart commented on WW-3925:
-----------------------------------
Could you prepare a sample project and attach it here ? On Maven would be the best :-)
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501776#comment-13501776 ]
haruhiko nishi commented on WW-3925:
------------------------------------
What is interesting here is that jsps are returned for the undefined path such as /my_context/foo or /my_context/bar and the jsps are defined in the @Result of the Index class.
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501875#comment-13501875 ]
haruhiko nishi commented on WW-3925:
------------------------------------
I will post a sample project here. Thank you for your attention.
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13507523#comment-13507523 ]
Lukasz Lenart commented on WW-3925:
-----------------------------------
Regarding Index action no, it's desired behaviour. Regarding the rest I think yes - I mean, each package under basePackage should create a namespace, so there should be namespaces /a/, /b/ and so on. Anyway it's very edge case and I'm going to postpone this issue.
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Fix For: 2.3.x
>
> Attachments: WW-3925.zip
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508435#comment-13508435 ]
haruhiko nishi commented on WW-3925:
------------------------------------
Is there any drawbacks or problems, besides the Index issue, which we might encounter if our current package structure does not conform to the package structure expected by convention plugin? Do you think we are already experiencing some performance issues due to how the package is layed out?
We appreciate your advice.
Thank you.
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Fix For: 2.3.x
>
> Attachments: WW-3925.zip
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501731#comment-13501731 ]
haruhiko nishi commented on WW-3925:
------------------------------------
Thank you for your attention. I will certainly do that.
In the documentation for the convention plugin found at http://struts.apache.org/2.1.6/docs/convention-plugin.html, there is mentioning about
"Default action and result handling (i.e. /products will try com.example.actions.Products as well as com.example.actions.products.Index)"
which I'm guessing it is somehow related to what we have confirmed in our scenario.
Strangely narrowing the scope of the basePackage as above mentioned hits the Index action class. Obviously, action class named Index is treated differently than other action class and knowing how it is treated will possible give us some clue how to fix our problem.
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> om.example.common, in which the aforementioned Index file can be immediately found by narrowing the search scope, requesting /my_context/ displays the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501734#comment-13501734 ]
Lukasz Lenart commented on WW-3925:
-----------------------------------
There can be few other as setting struts.convention.package.locators.basePackage means that the packages below will be treated as namespaces, also using @Result can be misleading, remove it or define correct result.
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (WW-3925) behavior of Index action found
under designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13502454#comment-13502454 ]
haruhiko nishi edited comment on WW-3925 at 11/22/12 3:11 AM:
--------------------------------------------------------------
The attachement has the struts.convention.package.locators.basePackage wrongly configured to as below:
This is a case when Index is hit as Index resides within the j directory.
<constant name="struts.convention.package.locators.basePackage" value="com.example.j"/>
If you change the entry to
<constant name="struts.convention.package.locators.basePackage" value="com.example"/>
the aforementioned error is raised.
Sorry for inconvenience if this might have troubled you reproducing the problem.
was (Author: hanishi):
The attachement has the struts.convention.package.locators.basePackage configured to wrongly as below:
This is a case when Index is hit as Index resides within the j directory.
<constant name="struts.convention.package.locators.basePackage" value="com.example.j"/>
If you change the entry to
<constant name="struts.convention.package.locators.basePackage" value="com.example"/>
the aforementioned error is raised.
Sorry for inconvenience if this might have troubled you reproducing the problem.
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Fix For: 2.3.8
>
> Attachments: WW-3925.zip
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukasz Lenart updated WW-3925:
------------------------------
Fix Version/s: 2.3.8
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> om.example.common, in which the aforementioned Index file can be immediately found by narrowing the search scope, requesting /my_context/ displays the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501729#comment-13501729 ]
Lukasz Lenart commented on WW-3925:
-----------------------------------
Could you first ask your question on the "Struts Users Mailing List" <us...@struts.apache.org> ?
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> om.example.common, in which the aforementioned Index file can be immediately found by narrowing the search scope, requesting /my_context/ displays the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukasz Lenart updated WW-3925:
------------------------------
Fix Version/s: (was: 2.3.8)
2.3.x
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Fix For: 2.3.x
>
> Attachments: WW-3925.zip
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
haruhiko nishi updated WW-3925:
-------------------------------
Priority: Major (was: Trivial)
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Fix For: 2.3.8
>
> Attachments: WW-3925.zip
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
haruhiko nishi updated WW-3925:
-------------------------------
Attachment: WW-3925.zip
I have attached a sample maven project.
Index action is found under the package com.example.j.action
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
> Attachments: WW-3925.zip
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
haruhiko nishi updated WW-3925:
-------------------------------
Description:
We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
<constant name="struts.action.extension" value=","/>
When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
However, if we provide /my_context/, we receive the following error:
HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
Currently, our convention-plugin settings are declared as follows:
<constant name="struts.convention.package.locators.basePackage" value="com.example"/>
<constant name="struts.convention.package.locators" value="action"/>
Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
We appreciate your responses.
Thank you in advance.
was:
We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
<constant name="struts.action.extension" value=","/>
When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
However, if we provide /my_context/, we receive the following error:
HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
Currently, our convention-plugin settings are declared as follows:
<constant name="struts.convention.package.locators.basePackage" value="com.example"/>
<constant name="struts.convention.package.locators" value="action"/>
Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
om.example.common, in which the aforementioned Index file can be immediately found by narrowing the search scope, requesting /my_context/ displays the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
We appreciate your responses.
Thank you in advance.
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13502007#comment-13502007 ]
haruhiko nishi commented on WW-3925:
------------------------------------
mvn clean package
mvn jetty:run
should launch the project.
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
> Attachments: WW-3925.zip
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13506097#comment-13506097 ]
haruhiko nishi commented on WW-3925:
------------------------------------
I was wondering if this is considered a bug?
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Fix For: 2.3.8
>
> Attachments: WW-3925.zip
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3925) behavior of Index action found under
designated package is unclear
Posted by "haruhiko nishi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13502454#comment-13502454 ]
haruhiko nishi commented on WW-3925:
------------------------------------
The attachement has the struts.convention.package.locators.basePackage configured to wrongly as below:
This is a case when Index is hit as Index resides within the j directory.
<constant name="struts.convention.package.locators.basePackage" value="com.example.j"/>
If you change the entry to
<constant name="struts.convention.package.locators.basePackage" value="com.example"/>
the aforementioned error is raised.
Sorry for inconvenience if this might have troubled you reproducing the problem.
> behavior of Index action found under designated package is unclear
> ------------------------------------------------------------------
>
> Key: WW-3925
> URL: https://issues.apache.org/jira/browse/WW-3925
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.4
> Environment: JBoss 5.1
> Windows 7 x64
> Reporter: haruhiko nishi
> Priority: Trivial
> Fix For: 2.3.8
>
> Attachments: WW-3925.zip
>
>
> We have an Action class named 'Index' immediately under com.example.common.action and is annotated @ParentPackage('default') which is declared in package directive in struts.xml and has "/" for its namespace and extends "struts-default". It also declares @Result so that it responses with jsp files corresponding the string values returned by its execute() method.
> In our struts.xml, the following struts setting is configured along with other necessary configurations that are needed for convention-plugin.
> <constant name="struts.action.extension" value=","/>
> When accessing /my_context/none_existing_path, the request apparently hits this Index class and the contents of the jsp declared in the Index's @Result section gets returned.
> However, if we provide /my_context/, we receive the following error:
> HTTP Status 404-There is no Action mapped for namespace[/] and action name [] associated with context path [/my_context].
> We want to know the reason why accessing /my_context/none_existing_path, where none_existing_path has no matching action, can fallback to Index class, but error is returned when when the URL requested is just /my_context/.
> Currently, our convention-plugin settings are declared as follows:
> <constant name="struts.convention.package.locators.basePackage" value="com.example"/>
> <constant name="struts.convention.package.locators" value="action"/>
> Strangely, if we changed the value of the struts.convention.package.locators.basePackage to
> com.example.common and narrowed the search scope of the aforementioned Index file, requesting /my_context/ displayed the content of the jsps declared in @Result section of the Index class. However, as our action classes are distributed throughout the com.example.[a-z].action packages, where [a-z] represents the large volume of directories we have in our package structure, we cannot use this trick as a workaround. We have also tried placing index.jsp at the top level of the class path, and have the index.jsp redirect to /my_context/index, which worked but not what we want. Could this be a bug?
> We appreciate your responses.
> Thank you in advance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira