[
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