JSP页面代码:
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
<script type="text/javascript">
function add() {
window.self.location = "additem.do";
}
</script>
</head>
<body>
<form >
<input type="submit" value="sb" οnclick="add()">
</form>
</body>
</html>
struts-config.xml代码:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
<struts-config>
<action-mappings>
<action path="/additem"
forward="/item_add.jsp"
/>
</action-mappings>
<message-resources parameter="MessageResources" />
</struts-config>
为什么转不到新的页面上去