Struts地址中的method

<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'login.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 reg() {
document.forms[0].action="loginAction.action?method:register";
document.forms[0].submit();
}
</script>
</head>

<body>
<form action="loginAction.action" method="post">

用户名:
<input name="uname">

<br />
密 码:
<input name="pwd">

<br />
<input type="submit" value="登录">
<input type="button" value="注册" onclick="reg();"/>
</form>
</body>
</html>
loginAction.action?method:register中的冒号能不能换成等号 ?为什么用冒号?有什么区别

你可能感兴趣的:(jsp,struts)