[
https://issues.apache.org/jira/browse/WW-3803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13259545#comment-13259545
]
nick edited comment on WW-3803 at 4/23/12 12:07 PM:
----------------------------------------------------
The following plugins are in Discovered plugin XML list
{noformat}
vfs:/C:/Server/jboss-as-7.1.0.Final-SNAPSHOT/standalone/deployments/egov.ear/lib/struts2-config-browser-plugin-2.3.4-SNAPSHOT.jar/struts-plugin.xml
vfs:/C:/Server/jboss-as-7.1.0.Final-SNAPSHOT/standalone/deployments/egov.ear/lib/struts2-convention-plugin-2.3.4-SNAPSHOT.jar/struts-plugin.xml
vfs:/C:/Server/jboss-as-7.1.0.Final-SNAPSHOT/standalone/deployments/egov.ear/lib/struts2-dojo-plugin-2.3.4-SNAPSHOT.jar/struts-plugin.xml
vfs:/C:/Server/jboss-as-7.1.0.Final-SNAPSHOT/standalone/deployments/egov.ear/lib/struts2-json-plugin-2.3.4-SNAPSHOT.jar/struts-plugin.xml
vfs:/C:/Server/jboss-as-7.1.0.Final-SNAPSHOT/standalone/deployments/egov.ear/lib/struts2-spring-plugin-2.3.4-SNAPSHOT.jar/struts-plugin.xml
{noformat}
Following is my struts.xml
{code:xml}
<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.configuration.xml.reload" value="false"/>
<constant name="struts.convention.exclude.parentClassLoader"
value="true" />
<constant name="struts.convention.action.fileProtocols"
value="jar,vfsfile,vfszip,vfs,zip" />
<constant name="struts.convention.result.path" value="/WEB-INF/jsp/"/>
<constant name="struts.custom.i18n.resources"
value="ApplicationResources,lcmsApplicationResources,custom" />
<constant name="struts.i18n.reload" value="false" />
<constant name="struts.locale" value="en_IN" />
<constant name="struts.multipart.maxSize" value="10485760" />
<constant name="struts.multipart.parser" value="jakarta"/>
<constant name="struts.convention.action.mapAllMatches" value="true" />
<constant name="struts.convention.default.parent.package" value="egov" />
<!-- Comma separated list of regular expressions of jar URLs to be scanned
-->
<constant name="struts.convention.action.includeJars" value=".*egov-.*" />
<!-- Packages whose name ends with one of these strings will be scanned for
actions
<constant name="struts.convention.package.locators" value="actions"/> -->
<!--
This makes the URL for an action like HelloWorldAction.java be
/helloWorld.action rather than /hello-world
By default Struts2 uses the SEOActionNameBuilder.
-->
<bean type="org.apache.struts2.convention.ActionNameBuilder"
name="defaultActionNameBuilder"
class="org.apache.struts2.convention.DefaultActionNameBuilder"/>
<constant name="struts.convention.actionNameBuilder"
value="defaultActionNameBuilder"/>
<package name="egov" extends="struts-default" >
<interceptors>
........ my custom interceptors
</interceptors>
<default-interceptor-ref name="egov-interceptors" />
<default-action-ref name="CatchAll"/>
<global-results>
<result
name="genericError">/error/genericError.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception"
result="genericError" />
</global-exception-mappings>
<action name="CatchAll">
<result>/error/pageNotFound.jsp</result>
</action>
</package>
</struts>
{code:xml}
was (Author: nick.sree):
The following plugins are in Discovered plugin XML list
{noformat}
vfs:/C:/Server/jboss-as-7.1.0.Final-SNAPSHOT/standalone/deployments/egov.ear/lib/struts2-config-browser-plugin-2.3.4-SNAPSHOT.jar/struts-plugin.xml
vfs:/C:/Server/jboss-as-7.1.0.Final-SNAPSHOT/standalone/deployments/egov.ear/lib/struts2-convention-plugin-2.3.4-SNAPSHOT.jar/struts-plugin.xml
vfs:/C:/Server/jboss-as-7.1.0.Final-SNAPSHOT/standalone/deployments/egov.ear/lib/struts2-dojo-plugin-2.3.4-SNAPSHOT.jar/struts-plugin.xml
vfs:/C:/Server/jboss-as-7.1.0.Final-SNAPSHOT/standalone/deployments/egov.ear/lib/struts2-json-plugin-2.3.4-SNAPSHOT.jar/struts-plugin.xml
vfs:/C:/Server/jboss-as-7.1.0.Final-SNAPSHOT/standalone/deployments/egov.ear/lib/struts2-spring-plugin-2.3.4-SNAPSHOT.jar/struts-plugin.xml
{noformat}
Following is my struts.xml
{code: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.1.7.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.configuration.xml.reload" value="false"/>
<constant name="struts.convention.exclude.parentClassLoader"
value="true" />
<constant name="struts.convention.action.fileProtocols"
value="jar,vfsfile,vfszip,vfs,zip" />
<constant name="struts.convention.result.path" value="/WEB-INF/jsp/"/>
<constant name="struts.custom.i18n.resources"
value="ApplicationResources,lcmsApplicationResources,custom" />
<constant name="struts.i18n.reload" value="false" />
<constant name="struts.locale" value="en_IN" />
<constant name="struts.multipart.maxSize" value="10485760" />
<constant name="struts.multipart.parser" value="jakarta"/>
<constant name="struts.convention.action.mapAllMatches" value="true" />
<constant name="struts.convention.default.parent.package" value="egov" />
<!-- Comma separated list of regular expressions of jar URLs to be scanned
-->
<constant name="struts.convention.action.includeJars" value=".*egov-.*" />
<!-- Packages whose name ends with one of these strings will be scanned for
actions
<constant name="struts.convention.package.locators" value="actions"/> -->
<!--
This makes the URL for an action like HelloWorldAction.java be
/helloWorld.action rather than /hello-world
By default Struts2 uses the SEOActionNameBuilder.
-->
<bean type="org.apache.struts2.convention.ActionNameBuilder"
name="defaultActionNameBuilder"
class="org.apache.struts2.convention.DefaultActionNameBuilder"/>
<constant name="struts.convention.actionNameBuilder"
value="defaultActionNameBuilder"/>
<package name="egov" extends="struts-default" >
<interceptors>
........ my custom interceptors
</interceptors>
<default-interceptor-ref name="egov-interceptors" />
<default-action-ref name="CatchAll"/>
<global-results>
<result
name="genericError">/error/genericError.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception"
result="genericError" />
</global-exception-mappings>
<action name="CatchAll">
<result>/error/pageNotFound.jsp</result>
</action>
</package>
</struts>
{code:xml}
> Convention Plugin treats struts.convention.package.locators as a part of
> package name
> -------------------------------------------------------------------------------------
>
> Key: WW-3803
> URL: https://issues.apache.org/jira/browse/WW-3803
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.3.1, 2.3.1.1
> Environment: JDK 6, JBoss AS 7.1.0 Final, Windows 7, Struts 2, EAR
> deployment.
> Reporter: nick
> Assignee: Lukasz Lenart
> Fix For: 2.3.4
>
>
> My struts.xml is as follows..
> {code:xml}
> <constant name="struts.devMode" value="true" />
> <constant name="struts.configuration.xml.reload" value="true"/>
> <constant name="struts.convention.exclude.parentClassLoader" value="true"
> />
> <constant name="struts.convention.action.fileProtocols"
> value="jar,vfsfile,vfszip,vfs,zip" />
> <constant name="struts.convention.result.path" value="/WEB-INF/jsp/"/>
> <constant name="struts.i18n.reload" value="false" />
> <constant name="struts.locale" value="en_IN" />
> <constant name="struts.multipart.maxSize" value="10485760" />
> <constant name="struts.multipart.parser" value="jakarta"/>
> <constant name="struts.convention.action.mapAllMatches" value="true" />
> <constant name="struts.convention.default.parent.package" value="egov" />
> <!-- Comma separated list of regular expressions of jar URLs to be
> scanned -->
> <constant name="struts.convention.action.includeJars" value=".*egov-.*" />
> <!-- Packages whose name ends with one of these strings will be scanned
> for actions -->
> <constant name="struts.convention.package.locators" value="actions"/>
> <!--
> This makes the URL for an action like HelloWorldAction.java be
> /helloWorld.action rather than /hello-world
> By default Struts2 uses the SEOActionNameBuilder.
> -->
> <bean type="org.apache.struts2.convention.ActionNameBuilder"
> name="defaultActionNameBuilder"
> class="org.apache.struts2.convention.DefaultActionNameBuilder"/>
> <constant name="struts.convention.actionNameBuilder"
> value="defaultActionNameBuilder"/>
> ......
> {code}
> my action package structure is like org.x.y.web.actions.transactions
> my jsp's are under WEB-INF/jsp/ transactions/
> I'm getting the following error
> {noformat}
> ERROR [com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor]
> (http-localhost-127.0.0.1-9080-2) No result defined for action
> org.x.y.web.actions.transactions.FirstAction and result new: No result
> defined for actionorg.x.y.web.actions.transactions.FirstAction and result new
> at
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:376)
> [xwork-core-2.3.1.jar:2.3.1]
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278)
> [xwork-core-2.3.1.jar:2.3.1]
> at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:100)
> [xwork-core-2.3.1.jar:2.3.1]
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
> [xwork-core-2.3.1.jar:2.3.1]
> {noformat}
> Its hitting FirstAction class method and returning string "new"
> (first-new.jsp)
> My WEB-INF/jsp/ transactions/ folder has first-new.jsp.
> I guess this may be a bug in conventional-plugin
> i have commented out <constant name="struts.convention.package.locators"
> value="actions"/>
> and tried it but it doesn't worked out.
> Then i have changed my package name from transactions to trns.........
> ie :
> my action package structure is like org.x.y.web.actions.trns
> my jsp's are under WEB-INF/jsp/ trns/
> there it goes, its working perfectly :) .
> i'm facing it when i use transactions as package name (Is it something to do
> with trans"actions").
> even i guess this will be applicable for all package names starts or ends
> with "actions"
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira