Struts2.5新版本中的action三种实现方法
来源:互联网 发布:淘宝图片要求尺寸 编辑:程序博客网 时间:2024/05/17 01:24
前言:在struts2.5中添加了新的标签allowed-methods
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<!--第1种最直接的 -->
<struts>
<package name="a" extends="struts-default" namespace="/">
<action name="hello" class="com.HelloWorld">
<result name=""></result>
</action>
</package>
</struts>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<!--第2种使用通配符实现在新版本中需要在result后添加 allowed-method标签 -->
<struts>
<package name="a" extends="struts-default" namespace="/">
<action name="hello_*" class="com.HelloWorld" method="{1}">
<result name=""></result>
<!--allowed-methods中直接写方法名,多个方法用逗号隔开 -->
<allowed-methods>add,update</allowed-methods>
</action>
</package>
</struts>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<!--第3种动态访问 -->
<!-- 需要配置constant,name属性:struts.enable.DynamicMethodInvocation,具体查看default.properties-->
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="true"></constant>
<package name="a" extends="struts-default" namespace="/">
<action name="hello" class="com.HelloWorld" >
<result name=""></result>
<allowed-methods>add,update</allowed-methods>
</action>
</package>
</struts>
- Struts2.5新版本中的action三种实现方法
- Struts2 Action的三种实现方法
- Struts2 动态Action的三种实现方法
- Struts2 动态Action的三种实现方法
- Struts2--动态Action的三种实现方法
- Struts2创建Action的三种方法
- Struts2 action的三种实现方式
- [struts2]Struts2 Action扩展名的三种修改方法
- struts2中的jsp值传到后台action接收的三种方法
- struts2中的jsp值传到后台action接收的三种方法
- Struts2 访问Action中的指定方法 三种方式的总结
- Struts2中一个Action多个请求处理方法的三种实现方式
- Struts2中一个Action多个请求处理方法的三种实现方式
- Struts2的Action属性名和s三种实现方法
- structs实现三种action的方法
- Struts2-----5、Struts2实现Action
- Struts2中Action访问Servlet API的三种方法
- Struts2中Action访问Servlet API的三种方法
- java中的java.lang.Class对象
- FreeMarker获取页面的session、request
- C#导出Excel表格失败
- I/O多路复用机制(一)
- sql server2008R2 备份所有数据库
- Struts2.5新版本中的action三种实现方法
- 图解Android
- oracle 10g要开启哪些服务
- linux grep命令详解
- NetMQ 解读
- Android中将webp格式图片转换为png和jpg(续)
- 【PM】项目管理之进度:如果发现因为种种原因导致实际工期远远超出预计工期时,你应该怎么做
- selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PAT
- 认识注解(Annotation)