Date: 2004-09-17T00:16:40
Editor: MichaelMcGrady <[EMAIL PROTECTED]>
Wiki: Apache Struts Wiki
Page: StrutsCatalogSimpleDispatchAction
URL: http://wiki.apache.org/struts/StrutsCatalogSimpleDispatchAction
no comment
Change Log:
------------------------------------------------------------------------------
@@ -103,15 +103,21 @@
String methodName = null;
String buttonValue = null;
String parameter = mapping.getParameter();
-
- if((parameter != null) && (parameter.endsWith(".x"))) {
- methodName = parameter.substring(0,parameter.indexOf('.'));
+ if((parameter != null) && (parameter.startsWith("method."))) {
+ methodName = parameter.replaceFirst("method.","");
} else {
Enumeration enum = request.getParameterNames();
while(enum.hasMoreElements()) {
buttonValue = (String)enum.nextElement();
- if(buttonValue.endsWith(".x")) {
- methodName = buttonValue.substring(0,buttonValue.indexOf(".x"));
+ if(buttonValue.startsWith("method.")) {
+ methodName = buttonValue.replaceFirst("method.","");
+ if(methodName.endsWith(".x")) {
+ methodName = methodName.replaceFirst(".x","");
+ }
+ if(buttonValue.endsWith(".y")) {
+ methodName = methodName.replaceFirst(".y","");
+ }
+ break;
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]