You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/01/15 15:17:12 UTC

DO NOT REPLY [Bug 26168] New: - wildcard action mapping doesn't work

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26168>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26168

wildcard action mapping doesn't work

           Summary: wildcard action mapping doesn't work
           Product: Struts
           Version: 1.1 Final
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Controller
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: darkeye@tyrell.hu


I'm having problem with making the wildcard action mapping to get to work, as
described in section 4.10 of the user guide:
http://jakarta.apache.org/struts/userGuide/building_controller.html#action_mapping_wildcards

I have the action servlet properly configured in web.xml, and have the following
static mapping in stuts-config.xml, which works properly:

<struts-config>
                                                                                
    <action-mappings>
        <action path="/showUrlList"
                type="hu.tilos.site.ShowUrlListAction">
            <forward name="success" path="/showUrlList.jsp"/>
        </action>
    </action-mappings>

</struts-config>


if I change this to a dynamic mapping that should invoke the same action:
<struts-config>
                                                                                
    <action-mappings>
         <action path="/show*"
                type="hu.tilos.site.Show{1}Action">
            <forward name="success" path="/show{1}.jsp"/>
        </action>                                                              
               
    </action-mappings>

</struts-config>

it simply doesn't work, my catalina.out says:
15:14:18,896 ERROR RequestProcessor:683 - Invalid path /showUrlList was requested


it seems that the wildcard is expanded to /showUrlList , but the an action map
by that name is not found. the following config, without {1} marks, has the same
effect:

         <action path="/show*"
                type="hu.tilos.site.ShowUrlListAction">
            <forward name="success" path="/showUrlList.jsp"/>
        </action>                                                              
               



I'm using Tomcat 5.0.16, and the action servlet mapping in my web.xml file is as
follows:

    <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
            <param-name>debug</param-name>
            <param-value>2</param-value>
        </init-param>
        <init-param>
            <param-name>detail</param-name>
            <param-value>2</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
                                                                                
    <!-- Standard Struts Action Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org