I\'m new to Java EE and Struts2. I need to know if I\'m doing it wrong or not.
I\'ve got a link like this : http://localhost:8080/myProject/deleteUser?idUser=42
Try this:
ActionContext context = ActionContext.getContext();
Map params = context.getParameters();
String userId = findParam("idUser", params);
public String findParam(String key, Map params) {
Object obj = params.get(key);
if(obj != null) {
String[] values = (String[])obj;
return values.length > 0 ? values[0] : null;
}
return null;
}