Struts2 数据 标签 之 Action Tag
来源:互联网 发布:python pdf下载 编辑:程序博客网 时间:2024/04/30 07:14
Action Tag
The action tag is a generic tag that is used to call actions directly from a JSP page by specifying the action name and an optional namespace. The body content of the tag is used to render the results from the Action. Any result processor defined for this action in struts.xml will be ignored, unless the executeResult parameter is specified.
Add the following code snippet into the struts.xml file.
struts.xml
<action name="actionTag" class="net.roseindia.actionTag">
<result name="success">/pages/genericTags/success.jsp</result>
</action>
Create an action class as shown below:
actionTag.java
package net.roseindia;
import com.opensymphony.xwork2.ActionSupport;
public class actionTag extends ActionSupport {
public String execute() throws Exception{
return SUCCESS;
}
}
Now create a jsp page using <s:action
>
tag as shown in the success.jsp page. The action tag is used to call actions directly from a JSP page by specifying the action name and an optional namespace.
success.jsp
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Action Tag Example!</title>
</head>
<body>
<h1><span style="background-color: #FFFFcc">Action Tag
(Data Tags) Example!</span></h1>
<s:action name="success">
<b><i>The action tag will execute the result and include
it in this page.</i></b></div>
</s:action>
</body>
</html>
Output of the success.jsp
- Struts2 数据 标签 之 Action Tag
- Struts2 数据 标签 之 Bean Tag
- Struts2 数据 标签 之 Date Tag
- Struts2 数据 标签 之 Include Tag
- Struts2 数据 标签 之 Text Tag
- Struts2 数据 标签 之 Property Tag
- struts2标签 数据标签 action
- Struts2标签 数据标签---action标签
- Struts2 控制 标签 之 Generator Tag
- Struts2 控制 标签 之 Iterator Tag
- Struts2 控制 标签 之 Merge Tag
- Struts2 控制 标签 之 Subset Tag
- struts2的标签tag
- struts2 自定义tag标签
- Struts2.0标签使用之action
- Struts2之数据标签(一)
- Struts2之数据标签(二)
- struts2 tag 标签应用基础
- ASP.NET 中级
- Android电源管理系统调研报告-(5)
- JQuery 正则表达式
- 备忘录:简单的分页
- css+div+ul中向菜单
- Struts2 数据 标签 之 Action Tag
- WP7 Dev 101 【0】 开发环境的准备
- [转]简单内存泄漏检测方法 解决 Detected memory leaks! 问题
- 四大图像库的使用感受:OpenCV/FreeImage/CImg/CxImage
- 中向菜单
- 搜索引擎 蜘蛛程序源代码
- 网卡的混杂模式
- 你应当如何学习C++(以及编程)(刘未鹏)
- 智器smartQ5的android开源网站