But, in short, you're right.

Whoops; no, you're not, although there was an error along these lines in the current code.


Here's what is there right now:

[1] // Check to see if request processor uses struts-chain. If so,
// no need to replace the request processor.
if (configProcessorClass.isAssignableFrom(ComposableRequestProcessor.class)) {
return;
}


[2] // Check if it is the default request processor or Tiles one.
// If true, replace by Tiles' one.
if (configProcessorClassname.equals(RequestProcessor.class.getName())
|| configProcessorClassname.endsWith(tilesProcessorClassname)) {
ctrlConfig.setProcessorClass(tilesProcessorClassname);
return;
}


[3] // Check if specified request processor is compatible with Tiles.
Class tilesProcessorClass = TilesRequestProcessor.class;
if (!tilesProcessorClass.isAssignableFrom(configProcessorClass)) {
// Not compatible
String msg =
"TilesPlugin : Specified RequestProcessor not compatible with TilesRequestProcessor";
if (log.isFatalEnabled()) {
log.fatal(msg);
}
throw new ServletException(msg);
}



The first test, [1] is an error of the sort you observed. It should be testing to make sure that the specified class is a subclass of ComposableRequestProcessor.class and not the other way around.


The second test, [2], seems dubious. Particularly testing against class names. If it weren't for a concern with breaking Struts installations which use Tiles and don't specify the TilesRequestProcessor, i'd remove this. However, now that in Struts 1.3 the default processor is the ComposableRequestProcessor, this test will never be evaluated unless someone has explicitly set their processor class, and in that case, they should explicitly set it *correctly* ;-) Still, i'll leave it in there temporarily in case I'm missing something.

The third test, [3], is correct. Assure that the current configProcessorClass extends TilesRequestProcessor. No need to change it.

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex


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



Reply via email to