I believe this is a duplicate to bug # 12702, which has a proposed patch
already submitted.

Steve

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 09, 2002 3:52 PM
To: [EMAIL PROTECTED]
Subject: DO NOT REPLY [Bug 13473] New: - Action path truncated when
start matches a sub-app prefix


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=13473>.
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=13473

Action path truncated when start matches a sub-app prefix

           Summary: Action path truncated when start matches a sub-app
                    prefix
           Product: Struts
           Version: 1.1 Beta 2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Controller
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When you have multiple sub-apps, it appears that
any action mappings which start with text exactly matching
one of the sub-app prefixes get interpreted as being a sub-app
path.

For example, assume you have a sub-app with a prefix of
"/admin".  If you have action mappings in the default sub-app
such as "/adminmenu" or "/adminusers", the paths that get forwarded to
become "menu" or "users" (respectively).  So, it looks like it pulls
off the "/admin" from the front (since it matches a sub-app prefix)
and attempts to forward to that.

Reproducing:

1. Have a web.xml with:

...
  <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>config/admin</param-name>
      <param-value>/WEB-INF/struts-config-admin.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>5</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>validating</param-name>
      <param-value>true</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>
...
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
...


2. Have an action mapping in struts-config.xml (for default app) such as:

    <action    path="/adminmenu"
               type="org.apache.struts.actions.ForwardAction"
          parameter="/whatever.jsp"
              scope="request"
           validate="false" >
    </action>

3. Have a struts-config-admin.xml (can be basically empty I think;
mine only has one action mapping called "/main").

4. Have a page with either an <a href="adminmenu.do"> or an
<html:link page="/adminmenu.do">.

5. When you run the app and click on that link you get the
following error:

============================================================================
====
HTTP Status 400 - Invalid path menu was requested
----------------------------------------------------------------------------
----
type Status report
message Invalid path menu was requested
description The request sent by the client was syntactically incorrect
(Invalid path menu was requested).
----------------------------------------------------------------------------
----
Apache Tomcat/4.1.10
============================================================================
====

Also, with struts debugging on, an output like the following is seen:

2002-10-09 18:01:37 ERROR [Thread-3] struts.action.RequestProcessor -
Invalid 
path menu was requested


6.  If you simply comment out the config/admin section of the web.xml,
reload the app and try again, you should be able to get to the
"whatever.jsp"
page that you set for the /adminmenu action mapping.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to