Bugs when having no action extension
Herbert Poul <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.webwork |
|---|---|
| Message-ID | <26129795.1148848143720.JavaMail.os-j2ee@opensymphony01.managed.contegix.com> |
hi,
sorry if those bugs are known (haven't found anything on the forums, or jira.. but just to make sure i'm asking here first)
I've now encountered two bugs which are easily fixed when the default extension is "". Both are related to the DefaultActionMapper having 'null' when calling 'getDefaultExtension':
The first is that the 'static' content of css is not retrieved because FilterDispatcher would call DefaultActionMapper.getMapping(request) and if null .. see if the request starts with /webwork/ .. and if so .. process the request.. and return the static content ..
the call hierarchy is something like: (all within DefaultActionMapper): getMapping -> parseNameAndNamespace .. -> mapping.setName(dropExtension(name)) ...
now .. dropExtension(name) would just return 'name' because extension is not defined.. which means .. the mapping has set a name.. and 'getMapping' wouldn't therefore return null.. (it only returns null if mapping.getName() is null)
i've simply worked around it by providing my own very very simple ActionMapper by extending DefaultActionMapper and in getMapping() returning 'null' if it starts with e.g. /webwork, /css, /dwr
i guess the best way would be to simply create a more generic way to configure mappings which always be ignored.. (and therefore be served by the static content, or just completely ignored by the webwork filter)
the second problem is also in the DefaultActionMapper - in the method: getUriFromActionMapping
i've wanted to redirect to another action .. with a parameter.. but the code looks like (starting line 309): ;)
[code]
String extension = getDefaultExtension();
if ( extension != null && uri.indexOf( '.' + extension) == -1 ) {
uri.append(".").append(extension);
if ( params.length() > 0) {
uri.append(params);
}
}
[/code]
just moving the inner if out of the outer if .. would do the trick i guess :)
sorry if those problems are known .. but haven't found any information on it .. (usually i could simply provide a patch for the first problem.. but since there are dozens of ways to solve my issue i think it should be considered by someone who has a broader grasp of webwork ;) )
thanks & cu
Herbert Poul
http://goim.us
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=32607&messageID=63162#63162
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]