
|
If you were logged in you would be able to see more operations.
|
|
|
|
is there any way you could make ServletDispatcher.getActionName(String) protected instead of private?
or even change it to say, getActionName(HttpServletRequest)? it would make ServletDispatcher a LOT more extendable...
as it currently stands, you have to override the entire service() method, but, I'd assume, a fair number of people are only going to need to change the getActionName() method.
maybe something like this... or maybe pass the extraContext in too... I don't know... whatever you think is "best"
protected String getActionName(HttpServletRequest req) {
String actionName = req.getServletPath();
// Get action name ("Foo.action" -> "Foo" action)
int beginIdx = name.lastIndexOf("/");
int endIdx = name.lastIndexOf(".");
return name.substring(((beginIdx == -1) ? 0 : (beginIdx + 1)), (endIdx == -1) ? name.length() : endIdx);
}
|
|
Description
|
is there any way you could make ServletDispatcher.getActionName(String) protected instead of private?
or even change it to say, getActionName(HttpServletRequest)? it would make ServletDispatcher a LOT more extendable...
as it currently stands, you have to override the entire service() method, but, I'd assume, a fair number of people are only going to need to change the getActionName() method.
maybe something like this... or maybe pass the extraContext in too... I don't know... whatever you think is "best"
protected String getActionName(HttpServletRequest req) {
String actionName = req.getServletPath();
// Get action name ("Foo.action" -> "Foo" action)
int beginIdx = name.lastIndexOf("/");
int endIdx = name.lastIndexOf(".");
return name.substring(((beginIdx == -1) ? 0 : (beginIdx + 1)), (endIdx == -1) ? name.length() : endIdx);
} |
Show » |
|