Can you verify your assumption with the logging output? It should say what the value of matchPath is. This would be a debug-level logging statment indicated by a line stating:

Selecting module for path <matchPath>

You may have to turn up the volume on your logging output to see it. I'd be most interested in what's going on here.

If there is a case where the first character of matchPath may not be a "/" then that condition needs to change to a > instead of !=. I was of the impression that the first element of that string would always be a "/".

Erik Hatcher wrote:

More information after digging a bit. The change to RequestUtils (in version 1.61) has this log:

Revision : 1.61
Date : 2002/10/15 17:37:25
Author : 'ekbush'
State : 'Exp'
Lines : +33 -11
Description :
Change RequestUtils.selectApplication so that it looks for an exact
match
rather than using the startsWith criteria.This fixes a problem where
an incorrect module would be selected that either became aparant when
the application had modules where the name of one could be used as the
"root"
of the other.The bug also manifests itself when an action is invoked
from
the default module, which has a path that could be interpreted as a
"root" of
a non-default module.

Ex:modules /foo and /foobar
module /foo and action /foo in the default module

PR: 12702

And here is the relevant change:

while (prefix.equals("") &&
((lastSlash = matchPath.lastIndexOf("/")) != 0)) {

// We may be in a non-default module. Try to get it's
prefix.
matchPath = matchPath.substring(0, lastSlash);

// Match against the list of module prefixes
for (int i = 0; i < prefixes.length; i++) {
if (matchPath.equals(prefixes[i])) {
prefix = prefixes[i];
break;
}
}
}

lastIndexOf is obviously returning -1 meaning that there is no "/" in matchPath. My application works fine deployed, so this seems like an interaction with StrutsTestCase or Cactus with the servlet path being null.

If anyone has ideas on where to dig further to see where a fix is needed then I'd happily take it the extra distance and give it a shot to fix it.

Erik

--
Eddie Bush




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

Reply via email to