struts1 的例子????
来源:百度知道 编辑:UC知道 时间:2024/06/22 18:01:28
继承DispatchAction类即可在Action中自定义方法
//parentlist页面
public ActionForward list(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
//权限检查
if(!UserDao.checkRight((String)request.getSession().getAttribute("User"),"故障管理",request))
{
request.setAttribute("message","您无权使用该功能!");
return mapping.findForward("rightlimited");
}
MalfunctionActionForm newform = (MalfunctionActionForm)form;
//引入地域
String areaid = (String)request.getSession().getAttribute("Areaid");
String areaids = AreaId.getAreaIds(areaid);
//引入条件处理
String type = request.getParameter("type");
if(type==null||"".equals(type)){
type = newform.getSelecttype();
if(type==null||"".equals(type)){
type = "0";<