Issue Details (XML | Word | Printable)

Key: WW-161
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Mathias Bogaert
Reporter: Noah Nordrum
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
WebWork

ServletDispatcher could be a lot simpler to extend

Created: 25/Apr/03 05:34 PM   Updated: 20/Oct/04 07:14 AM
Component/s: Dispatch
Affects Version/s: 2.0-beta1, 2.0-beta2, 2.1
Fix Version/s: 2.1.5


 Description  « Hide
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);
    }

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Hani Suleiman added a comment - 20/Nov/03 12:19 PM
Fixed in 1.4 CVS

Mathias Bogaert added a comment - 20/Oct/04 07:14 AM
This seems already fixed in this version. getActionName is protected.