struts框架从.jsp页面直接访问action
<%@ page language="java" pageEncoding="UTF-8"%><%
String path = request.getContextPath();
%>
<html>
<head>
<title></title>
<meta http-equiv="refresh" content="0;url=<%=path%>/action.do">
</head>
<body>
</body>
</html>
或者用JS跳转:
<%@ page language="java" pageEncoding="UTF-8"%><%
String path = request.getContextPath();
%>
<html>
<head>
<title></title>
</head>
<body>
<script>
document.location = '<%=path%>/action.do';
</script>
</body>
</html>
作者:森林木马
-------------------------------------------
特此声明:所有评论和私信都会在第一时间回复。也欢迎朋友们指正错误,共同进步!
如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,博主在此感谢!
个性签名:好记性不如勤随笔,好随笔还请多关注!