- Revision
- 92
- Author
- mauro
- Date
- 2007-05-27 15:57:01 -0500 (Sun, 27 May 2007)
Log Message
Better readability.
Modified Paths
Diff
Modified: trunk/core/src/main/java/org/codehaus/waffle/action/AbstractMethodDefinitionFinder.java (91 => 92)
--- trunk/core/src/main/java/org/codehaus/waffle/action/AbstractMethodDefinitionFinder.java 2007-05-27 20:47:56 UTC (rev 91) +++ trunk/core/src/main/java/org/codehaus/waffle/action/AbstractMethodDefinitionFinder.java 2007-05-27 20:57:01 UTC (rev 92) @@ -64,7 +64,7 @@ if (methodName == null) { return findDefaultActionMethod(request, controller); - } else if (methodName.contains("|")) { // pragmatic definition takes precedence + } else if (isPragmaticActionMethod(methodName)) { // pragmatic definition takes precedence return handlePragmaticActionMethod(controller, methodName, request, response); } @@ -196,13 +196,21 @@ } private Object convertValue(String value, Class type) { - if ("".equals(value) && type.isPrimitive()) { + if (isEmpty(value) && type.isPrimitive()) { value = null; // this allows Ognl to use that primitives default value } return typeConverter.convertValue(null, null, null, null, value, type); } + private boolean isEmpty(String value) { + return value == null || value.length() == 0; + } + + private boolean isPragmaticActionMethod(String methodName) { + return methodName.contains("|"); + } + private MethodDefinition handlePragmaticActionMethod(Object action, String methodName, HttpServletRequest request,
To unsubscribe from this list please visit:
