随笔分类 - struts
摘要:使用Struts2,配置一切正常,使用常用tag也正常,但是在使用标记时,发现控制台总是输出警告信息,警告信息内容如下:警告:Noconfigurationfoundforthespecifiedaction: 'ShowMessage' in namespace: ''. Formactionde...
阅读全文
摘要:result type 如果是默认 第一次访问页面不会访问action,刷新才会请求type=redirect 第一次访问会直接访问action或者在调用地址加 url?+随机数
阅读全文
摘要:低版本@Override protected boolean acceptFile(Object action, File file, String filename, String contentType, String inputName, ValidationAware validation, Locale locale) {}2.3.14.2中@Override protected boolean acceptFile(Object action, File file, String filename, String contentType, String inputName, ...
阅读全文
摘要:延长action中属性的生命周期,包括自定义属性,以便在jsp页面中进行访问,让actionContextcleanup过滤器来清除属性,不让action自己清除。 为了使用WebWork,我们只需要在web.xml配置FilterDispatcher一个过滤器即可,阅读一下FilterDispatcher的JavaDoc和源码,我们可以看到它调用了: finally{ActionContextCleanUp.cleanUp(req);}在ActionContextCleanUp中,有这样的代码:req.setAttribute(CLEANUP_PRESENT, Boolean.TRUE)..
阅读全文
摘要:版本过期如图:org.apache.struts2.dispatcher.FilterDispatcher 换成:org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter 1 <filter> 2 <filter-name>struts2CleanupFilter</filter-name> 3 <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
阅读全文
摘要:1)Struts中的jar包jar包名称作用struts2-core-2.x.x.jarstruts2的核心jar包javassist-3.x.x.GA.jar一个开源的分析、编辑和创建Java字节码的类库(hibernate中也需要,引入其中一个即可)commons-io-2.x.x.jarcommons项目(commons项目就是java中一些常用的公共的组件)的io子项目,是处理异常的commons-lang-2.x.jarcommons项目中的lang包commons-fileupload-1.x.x.jarcommons项目中的关于文件上传的包, struts2.1.6版本后必须加入
阅读全文