[code]
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'forward.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">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function _submit()
{
document.forms[0].submit();
}
</script>
</head>
<body>
<%
if(request.getParameter("name")!=null)
out.print("<h1>"+request.getParameter("name")+"</h1>");
%>
<form action="jsp/forward.jsp" method="Get">
<input type="text" name="name"><br>
<a href="javascript:_submit()">submit</a>
</form>
</body>
</html>[/code]
须用javascript:方法名,方法中调用form.submit();
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'forward.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">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function _submit()
{
document.forms[0].submit();
}
</script>
</head>
<body>
<%
if(request.getParameter("name")!=null)
out.print("<h1>"+request.getParameter("name")+"</h1>");
%>
<form action="jsp/forward.jsp" method="Get">
<input type="text" name="name"><br>
<a href="javascript:_submit()">submit</a>
</form>
</body>
</html>[/code]
须用javascript:方法名,方法中调用form.submit();