chkal/pf-issue-test — Issue #2: PrettyViewHandler.getActionURL optimization
Author: chkal
Created: 2012-03-06 07:12:34+00:00
State: open

Originally filed by **aguiar.m...@gmail.com** on 2009-05-22T04:54:31

Google Code issue: http://code.google.com/p/prettyfaces/issues/detail?id=10

I think PrettyViewHandler.getActionURL method could be optimized. There's
some code there that is useless:

1. String actionURL = parent.getActionURL(context, viewId);
2. actionURL = prettyContext.stripContextPath(actionURL);
3. if (prettyContext.isPrettyRequest() && !inNavigation)
4. {
5. return prettyContext.getCalculatedActionUri();
6. }
7. else
8. {
9. return parent.getActionURL(context, viewId);
10. }
11. }

You have 2 calls on line 1 and 2 that does nothing. The isPrettyRequest()
already strips the context path from the url and the getActionURL is only
needed on the else branch. I think you can just remove the first two lines.

Cheers