Struts2中继承ActionSupport方法
2016-11-16 23:14
363 查看
1:jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
<a href="<%=basePath%>TestActionSupport.action">TestActionSupport</a>
</body>
</html>
2:Action
package com.study;
import com.opensymphony.xwork2.ActionSupport;
public class TestActionSupport extends ActionSupport{
private static final long serialVersionUID = 1L;
@Override
public String execute()
{
return "success";
}
}
3:jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'testActionSupport.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
Test ACtionSupport Page!
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
<a href="<%=basePath%>TestActionSupport.action">TestActionSupport</a>
</body>
</html>
2:Action
package com.study;
import com.opensymphony.xwork2.ActionSupport;
public class TestActionSupport extends ActionSupport{
private static final long serialVersionUID = 1L;
@Override
public String execute()
{
return "success";
}
}
3:jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'testActionSupport.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
Test ACtionSupport Page!
</body>
</html>
相关文章推荐
- 使用Struts2继承ActionSupport出现错误,简单解决方法
- struts做开发的时候action是继承Action方法还是ActionSupport方法
- struts2的传参和struts2的第二种开发方式(继承ActionSupport)
- struts做开发的时候action是继承Action方法还是ActionSupport方法
- struts做开发的时候action是继承Action方法还是ActionSupport方法
- 用Struts2中的ActionSupport中的validate方法进行表单验证
- 用Struts2中的ActionSupport中的validate方法进行表单验证
- struts2的actionsupport中的execute()方法理解
- struts2 Action中获取request, response对象的 几种 方法
- Struts2 get方法传递 中文 到Action乱码解决
- struts2:在Action类中获得HttpServletResponse对象的四种方法
- Struts2中Action接收参数的方法
- struts2的action的自定义方法和它的验证方法
- struts2 action向jsp传值方法 (struts2: how to set parameter?)
- struts2动态方法调用 ActionName!methodName.action
- 在Struts2的Action中取得请求参数值的几种方法
- struts2中action跳转到另一个action的方法
- struts2两个input方法的action,出错后总是返回到Input页面的解决方法
- Struts2教程6:在Action类中获得HttpServletResponse对象的四种方法
- Struts2 action的扩展名两种修改方法