
struts2
星辰nice
这个作者很懒,什么都没留下…
展开
-
struts2学习中碰到的问题
1、无法显示页面HTTP Status 500 – Internal Server ErrorType Exception ReportMessage The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Stru...原创 2018-07-23 22:37:09 · 441 阅读 · 0 评论 -
struts2入门-简单例子
首先去struts的官网https://struts.apache.org/download.cgi#struts2516,下载一个2.5及以上版本的struts2,选择下载Full Distribution,里面包含很多学习文档。建立一个java web项目,就和普通的java web项目一样的建立方法。在WEB-IINF中的lib文件夹中放入必要的jar包,都在刚下载的struts2文件中...原创 2018-07-19 09:12:14 · 1302 阅读 · 0 评论 -
action访问servlet获取页面信息
1、Action访问ActionContextActionContext类是一个Action执行的上下文,Action执行期间所用到的对象都保存在ActionContext中,如客户端提交的参数,session会话信息等。创建ActionContext的方法:ActionContext ac = ActionContext.getContext();ActionContext类中...原创 2018-07-24 21:45:57 · 530 阅读 · 0 评论 -
struts2部分核心组件解释
1、package配置在struts2中,是通过包配置来管理Action和拦截器的。在包中可以配置多个Action和拦截器。在struts.xml中,包是通过<package>来配置的。包配置在struts.xml中的格式如下:<package name="包名" extends="包名">......</package>常用属性:(1)name:指...原创 2018-07-19 19:45:49 · 761 阅读 · 0 评论 -
动态方法调用
每一个Action中都有一个execute方法,当我们调用相应的Action时,execute方法就会被默认执行。也就是说,每一个请求都对应一个Action,这样就会导致我们需要写很多个Action,即使它们是相关联的。为了减少Action的数量,减少重复编码,struts2提供了动态方法调用。将一组相关的业务放到同一个Action中,根据业务请求的不同而动态的调用相应的方法。1、method...原创 2018-08-13 16:43:19 · 950 阅读 · 0 评论