jsp页面部分代码:
action类:
public class GlydengluAction extends ActionSupport {
private String role;
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
return super.execute();
}
public String denglu(){
HttpServletRequest request = ServletActionContext.getRequest();
String roles = request.getParameter("role");
if(rand_input.equals(rand)){
System.out.println(roles);
return SUCCESS;
}else{
return INPUT;
}
}
}
System.out.println(roles);打印出来的就是option的value值。
就和普通参数一样获取哇,你就当是Input一样取就行了
request.getParameter(" ");