Struts2配置文件中使用通配符
来源:互联网 发布:篮球战术画图软件 编辑:程序博客网 时间:2024/05/18 00:59
形式一:调用相同Action中的不同方法
<action name="*Action" class="Jcuckoo.LoginRegistAction" method="{1}">
<result name="input">/login.jsp</result>
<result name="error">/error.jsp</result>
<result name="success">/welcome.jsp</result>
</action>
其中表达式{1}的值name属性值中第一个*的值。
如果用户请求的URL为loginAction.action,则调用Jcuckoo.LoginRegistAction中的login方法;
如果用户请求的URL为registerAction.action,则调用Jcuckoo.LoginRegistAction中的register方法;
形式二:通过匹配,调用不同的Action的execute方法
<action name="*Action" class="Jcuckoo.{1}Action">
<result name="input">/login.jsp</result>
<result name="error">/error.jsp</result>
<result name="success">/welcome.jsp</result>
</action>
上面没有出现method属性,故默认调用对应的execute方法
如果用户请求的URL为LoginAction.action,则调用Jcuckoo.LoginAction中的execute方法;
如果用户请求的URL为RegisterAction.action,则调用Jcuckoo.RegisterAction中的execute方法;
形式三:动态结果
<action name="crud_*" class="Jcuckoo.CrudAction" method="{1}">
<result name="input">/input.jsp</result>
<result>/{1}.jsp</result>
</action>
当处理结果是input时,会转到/input.jsp页面
当处理结果是success时,
如果crud_create.action,则会执行Jcuckoo.CrudAction中的create方法,并且跳转到/create.jsp;
如果crud_delete.action,则会执行Jcuckoo.CrudAction中的delete方法,并且跳转到/delete.jsp;
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/guoquanyou/archive/2008/12/02/3431290.aspx
- Struts2配置文件中使用通配符
- Struts2配置文件中使用通配符
- struts2--配置文件中使用通配符
- struts2-配置文件中通配符的使用
- struts2--配置文件通配符的使用
- Struts2配置文件通配符的使用
- Struts2配置文件中使用通配符收藏method="{1}"
- Struts2中使用通配符
- struts2中通配符使用
- struts2多配置文件使用通配符加载
- Struts2 spring 多配置文件使用通配符
- Struts2配置文件中的通配符的使用
- struts2中通配符的使用
- 【struts2】action中使用通配符
- 【struts2】action中使用通配符
- struts2——配置文件通配符!!!
- struts2通配符的使用
- struts2通配符的使用
- Unicode
- 未来网页搜索引擎技术的发展方向(转)
- javascript中的replace()函数
- 使用cliconfg.exe进行SQL Server网络连接设置
- 全兼容的标准三级菜单
- Struts2配置文件中使用通配符
- struts2.0核心配置文件struts.xml和struts.properties
- c# using 的三大用法
- VC++中进程间相互通信的十一种方法
- 树状数组的例题-校门外的树
- 我放弃保研了
- Struts2中Action访问Servlet API的两种方法
- 设置telnet回显
- ajax有用的网址收藏