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>
posted @ 2013-12-20 08:27  森林木马  阅读(434)  评论(0编辑  收藏  举报