![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
struts
臭崽的冰淇淋
这个作者很懒,什么都没留下…
展开
-
struts解决异常抛出的两种方法
1.使用自定义异常,继承exception然后在全局中抛出异常 注意:其中result属性为后面对应的result的结果名称 然后进入 excetion为类的全名 缺点:自定义异常类很多 2.在可能出现异常的地方用catch-try包裹(在action中) 此后直接retuen给我们的sturts处理 action中:原创 2017-12-03 21:46:09 · 671 阅读 · 0 评论 -
struts中哦欸之文件package下的顺序问题
The content of element type "package" must match "(result-types?,interceptors?,default-interceptor- ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings ?,action*)"原创 2017-12-05 19:40:45 · 128 阅读 · 0 评论 -
struts拦截器配置流程
1.新建拦截器实现MethodFilterInterceptor接口 public class PrivailegeInterceptor extends MethodFilterInterceptor { @Override protected String doIntercept(ActionInvocation invocation) throws Exceptio原创 2017-12-03 23:14:27 · 289 阅读 · 0 评论 -
struts2文件上传
页面部分: 1.表单必须post提交 2.表单提交类型enctype.必须多段式. 3.文件上传使用 组件 --> action="${pageContext.request.contextPath }/CustomerAction_add" metho原创 2018-01-11 21:30:27 · 92 阅读 · 0 评论 -
JSP The Struts dispatcher cannot be found异常的解决方法
报错: This is usually caused by using Struts tagswithout the associated filter. Struts tags are only usable when the request haspassed through its servlet filter, which initializes the Struts dispatc转载 2017-12-29 09:48:10 · 230 阅读 · 0 评论 -
struts标签使用示例
1.通过标签进行判断 使用原创 2017-11-21 20:20:56 · 224 阅读 · 0 评论 -
关于struts参数获取
使用属性驱动的时候我们一般会private Integer page;这样写一个set方法来获取参数 public void setPage(Integer page) { this.page = page; } 但是struts其实是调用set方法,将传递参数对应的第一个字母大写,找到其set方法,并将参数传入 所以我们使用page时可以直接写成: p原创 2018-01-14 16:14:28 · 163 阅读 · 0 评论 -
autowrited的使用
spring不但支持自己定义的@Autowired注解,还支持几个由JSR-250规范定义的注解,它们分别是@Resource、@PostConstruct以及@PreDestroy。 @Resource的作用相当于@Autowired,只不过@Autowired按byType自动注入,而@Resource默认按 byName自动注入罢了。@Resource有两个属性是比较重要的,分是nam转载 2018-01-06 21:05:56 · 3186 阅读 · 0 评论