Struts中多个超链接调用同样的action,只是返回结果不同的处理方法
jsp:
<a href="getColor.action?color="blue">blue</a>
<a href="getColor.action?color="red">red</a>
Action:
public String getColor(){
...
...
String hint = "this is color";
ActionContext.getContext().put("hint",hint);
if(color.equal("blue")){
return "blue color";
}else{
return "red color";
}
}