随笔分类 -  Struts2

摘要:看到别人用了Struts2和JSON,自己也想练练手。记录下练习过程中遇到的问题,以便参考。使用Maven新建项目:先挂上pom.xml 1 3 4.0.0 4 com.sk 5 struts 6 war 7 0.0.1-SNAPSHOT 8 struts Maven Webapp 9 http://maven.apache.org10 11 12 junit13 junit14 3.8.115 test16 ... 阅读全文
posted @ 2013-08-15 13:57 daveztong 阅读(828) 评论(0) 推荐(0)
摘要:用Struts2做一个文件上传来着,本来是想写个验证方法来限制文件大小的,结果发现根本走不到我的验证方法就开始报异常了:THE REQUEST WAS REJECTED BECAUSE ITS SIZE EXCEEDS THE CONFIGURED MAXIMUM,因为拦截器先把它给截下来了,根本不给我机会啊,咋个弄呢?Google了一下发现,Struts2上床文件先要通过commons-fileupload的检查,通过了才会交给struts2的fileUpload拦截器,一开始我把fileUpload的参数设置的很大都不行,因为没覆盖文件的maxSize,不扯了,下面是解决办法:首先在配置文 阅读全文
posted @ 2013-03-18 11:04 daveztong 阅读(929) 评论(0) 推荐(1)
摘要:To create a ModelDriven Action our Action class should implement theModelDriven interfaceand should include themodelDriven interceptor. The modelDriven interceptor is already included in the default stack.The next step is to implement thegetModel()method in such a way that it returns the application 阅读全文
posted @ 2013-03-17 11:47 daveztong 阅读(396) 评论(0) 推荐(0)