mirror of
https://github.com/apache/struts.git
synced 2026-08-11 09:36:57 +00:00
WW-3155 RestfulActionMapper iterates a map where it should only just do a lookup
thanks to Dion Sasmito for patch git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@802942 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -123,14 +123,11 @@ public class RestfulActionMapper implements ActionMapper {
|
||||
StringBuilder retVal = new StringBuilder();
|
||||
retVal.append(mapping.getNamespace());
|
||||
retVal.append(mapping.getName());
|
||||
for (Map.Entry<String, Object> entry : mapping.getParams().entrySet()) {
|
||||
String name = entry.getKey();
|
||||
if (name.equals(mapping.getName() + "Id")) {
|
||||
retVal.append("/");
|
||||
retVal.append(entry.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
Object value = mapping.getParams().get(mapping.getName() + "Id");
|
||||
if (value != null) {
|
||||
retVal.append("/");
|
||||
retVal.append(value);
|
||||
}
|
||||
|
||||
return retVal.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user