提交表单时,固定jsp页面

//获取后台传来的值进行判断

 






搜索

js代码

struts.xml配置文件



/WEB-INF/views/themes/default/station/station.jsp
/500.jsp

Action层代码

private int status;

public int getStatus() {
return status;
}

public void setStatus(int status) {
this.status = status;
}

public String queryStationList() {

String status1 = request.getParameter("status");//获取jsp页面传过来的值

int status = 0;
if(status1!=null){
status = Integer.parseInt(status1);
}else{
status = 1;
}
try {
stationService.findStationList(getPage(),stationName,this.province,this.city,status);
request.getSession().setAttribute("statuss", status);//将status的值存在域中,前台通过${statuss}获取值判断
return "success";
} catch (Exception e) {
logger.error("StationAction[getStationList]:" + e.getMessage());
return "fail";
}

}

你可能感兴趣的:(java,select,ssh,表单,jsp,逻辑运算符)