用a链接提交form,base标签引发的问题
在使用a标签提交表单的方式;如下
?
<a href="#" onclick="submit()">提交</a><script type="text/javascript">function submit() {var form = document.getElementById("form");form.submit();}</script>?如果在head中添加了base标签,内容为
?
<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><base href="<%=basePath%>">
?时候,点击提交后,页面会直接跳转到应用的根路径,即http://localhost:8080/WebRoot/#,就显示成主页面了
?