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:
Musachy Barroso
2009-08-10 22:06:48 +00:00
parent 9f6c296d42
commit e957eedb95
@@ -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();
}