一关于filter-class
struts2中StrutsPrepareAndExecuteFilter 异常如果是2.1.3之前的版本用org.apache.struts2.dispatcher.FilterDispatcher,否则用org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
二Struts工作原理
1用户发出一个HttpServletRequese请求actonmapper;
2dispathcher通过询问action mapper来确定请求调用哪个action,如果需要调用那个acton,则dispathcher将请求转交给actionProxy来处理;
3actionproxy通过配置文件管理器Confiiguration Manager询问框架的配置文 件Struts.xml,来调用action;
4actionproxy来创建一个实列actionInvocarion;
5action使用的前后,actionInvoction实例根据配置文件的加载和action相关的拦截器intercrptor;
6action执行完毕,actioninvocation实例根据配置文件的配置找到相应的结果;
7最后httpservletresponse响应通过web.xml文件的配置的过滤器返回。
三struts实例开发过程
1下载Tomcat服务器;下载地址http://tomcat.apache.org;
2布置tomcat服务器;首先选择windows中的preferences命令,打开server中的runtime environments节点,点击add按钮Tomcat服务器,Tomcat server添加Tomcat安装目录。
3为eclipse指定浏览器;general下的web browser单击use external web browser然后勾上default system web browser最后点击ok。
4新建项目;编写工程配置文件web.xml,添加Struts property文件,编写Struts.xml控制文件,开发前端页面index success.jsp,开发后端Struts处理程序action。