Struts 2
  1. Struts 2
  2. WW-3803

Convention Plugin treats struts.convention.package.locators as a part of package name

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1, 2.3.1.1
    • Fix Version/s: 2.3.4
    • Component/s: Plugin - Convention
    • Labels:
      None
    • Environment:

      JDK 6, JBoss AS 7.1.0 Final, Windows 7, Struts 2, EAR deployment.

      Description

      My struts.xml is as follows..

      <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"/>
      ......
      

      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

      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]
      

      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"

        Activity

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            nick
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development