1700484591
1700484592
//对ViewManager的应用
1700484593
1700484594
ViewManager viewManager=new ViewManager(actionName);
1700484595
1700484596
//所有参数放入值栈
1700484597
1700484598
ValueStack valueStack=valueStackHelper.putIntoStack(req);
1700484599
1700484600
//把所有的请求传递给ActionDispatcher处理
1700484601
1700484602
String result=actionDispatcher.actionInvoke(actionName);
1700484603
1700484604
String viewPath=viewManager.getViewPath(result);
1700484605
1700484606
//直接转向
1700484607
1700484608
RequestDispatcher rd=req.getRequestDispatcher(viewPath);
1700484609
1700484610
rd.forward(req,res);
1700484611
1700484612
}
1700484613
1700484614
public void init(FilterConfig arg0)throws ServletException{
1700484615
1700484616
/*
1700484617
1700484618
*1、检查XML配置文件是否正确
1700484619
1700484620
*2、启动监控程序,观察配置文件是否正确
1700484621
1700484622
*/
1700484623
1700484624
}
1700484625
1700484626
//通过url获得actionName
1700484627
1700484628
private String getActionNameFromURI(HttpServletRequest req){
1700484629
1700484630
String path=(String)req.getRequestURI();
1700484631
1700484632
String actionName=path.substring(path.lastIndexOf(”/”)+1,
1700484633
1700484634
path.lastIndexOf(”.”));
1700484635
1700484636
return actionName;
1700484637
1700484638
}
1700484639
1700484640
}
[
上一页 ]
[ :1.700484591e+09 ]
[
下一页 ]