struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Viji Sarathy" <vsara...@comframe.com>
Subject RE: Struts Sub Modules not Working with 1.1-rc1
Date Tue, 25 Mar 2003 03:05:31 GMT
I am not using Tomcat in the first place. 
I stepped through the Struts source code to find out how it figures out
if a certain request is meant to be directed to a resource in a
sub-module. That portion of the code, in the version of the source code
that I have, seems to always return the prefix that corresponds to the
default module, namely, "". 

Would you mind sending me the relevant portions of web.xml and a portion
of the struts-<sub-module>-config.xml that shows the configuration for
atleast one action mapping in the sub-module?

Thanks.
Viji Sarathy





> -----Original Message-----
> From: Navjot Singh [mailto:navjot.s@net4india.net] 
> Sent: Monday, March 24, 2003 10:34 PM
> To: Struts Users Mailing List
> Subject: Re: Struts Sub Modules not Working with 1.1-rc1
> 
> 
> No dear, it works. I have my setup working and running.
> 
> may be this would help you to locate your problem.
> 
> create a logging.properties with a line
> .level = FINE
> 
> and start the tomcat with logging.properties in system classpath
> 
> You will see better messages from struts and tomcat and will 
> help you in terms of module getting recognized or not.
> 
> HTH
> navjot singh
> 
> 
> 
> 
> ----- Original Message -----
> From: "Viji Sarathy" <vsarathy@comframe.com>
> To: "'Struts Users Mailing List'" <struts-user@jakarta.apache.org>
> Sent: Monday, March 24, 2003 4:16 PM
> Subject: Struts Sub Modules not Working with 1.1-rc1
> 
> 
> | Hello All:
> |
> | This is the first time I am posting to this mailing list.
> | If I have not followed any etiquettes properly, please forgive me.
> |
> | Here's my question:
> | I just updated from Struts 1.1-b2 to Struts 1.1-rc1.
> | I have an Web Application which has two Struts Applications (or 
> | Modules as they are now called). When I make an invocation on a 
> | resource in the sub-module, I get an "Invalid Path Requested" Error.
> |
> | My web.xml pertaining to Struts Configuration looks like this:
> |
> | <init-param>
> | <param-name>config</param-name>
> |
> | <param-value>/WEB-INF/struts-config.xml</param-value>
> | </init-param>
> | <init-param>
> | <param-name>config/pc</param-name>
> |
> | <param-value>/WEB-INF/struts-pc-config.xml</param-value>
> | </init-param>
> |
> |
> | The root context of the Web Application is "/mc".
> | So, when a request "/mc/pc/user" is received by Struts, it should 
> | figure out that it is meant for the Struts Sub-Module 
> "/pc". However, 
> | it does not. This used to work in 1.1.-b2.
> |
> | When I look in the Struts source code where this is done, 
> this is what 
> | I
> | found:
> |
> |     public static String getModuleName(String matchPath, 
> | ServletContext
> | context) {
> |         String prefix = "";
> |         String prefixes[] = getModulePrefixes(context);
> |         int lastSlash = 0;
> |
> |         while (prefix.equals("") && ((lastSlash =
> | matchPath.lastIndexOf("/")) > 0)) {
> |             matchPath = matchPath.substring(0, lastSlash);
> |             for (int i = 0; i < prefixes.length; i++) {
> |                 if (matchPath.equals(prefixes[i])) {
> |                     prefix = prefixes[i];
> |                     break;
> |                 }
> |             }
> |         }
> |         return prefix;
> |     }
> |
> | In the above, the argument matchPath is passed in as "/pc" after 
> | parsing the request's servlet path. But, the above algorithm will 
> | always return prefix="", is it not?
> |
> | Is this a bug ?
> |
> | Has anyone tried sub-applications with 1.1-rc1?
> |
> | Please help.
> | Thanks.
> | Viji Sarathy
> |
> |
> | 
> ---------------------------------------------------------------------
> | To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> | For additional commands, e-mail: struts-user-help@jakarta.apache.org
> |
> |
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


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


Mime
View raw message