struts框架从.jsp页面直接访问action

时间:2022-03-12 21:18:38
<%@ 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>