请求如果是AJAX则跳转失效,需要用浏览器普通的请求访问才起作用。
解决方案 »
- 一个有关proxool连接池的问题?
- JSP如何获取客户端的IP???????
- OsWorkflow中数据库配置问题,大侠们救我!
- 各位高手帮我看一看这是怎么会事?十分感谢!!!
- 困惑!一个很奇怪的问题,实在想不通
- word导成jsp或者html文件!
- 怎样通过servlet,jsp把服务器上的一个excel文件输出到浏览器显示和通过浏览器自动下载.
- 编写配置文件applicationContext.xml时,<?xml version="1.0" encoding="UTF-8" ?>出错!求高手解答!!
- weblogic8的配置问题
- 服务发布成功,但是使用wsimport生成客户端代码报错,找不到wsdl文件
- 只学了Struts2和Hibernate...有开源的BBS练手吗?
- 关于java使用mvc做web开发view层的效率
报错了,但是是因为shopcar是空才报错,我意图就是拦截空值的。我从正常页面进去就不会报错,正常页面是put key和value进shopcar集合的
好像是那个页面问题,但是我不知道有没有用ajax,就是我的登录页,有js的onSubmit判断用户登录的密码和账号是否为空,我换了个页面好像可以跳,请问该怎么解决吗,我就是要跳到那个页去的,不能换的
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="UTF-8"%>
<html>
<head>
<title>美食街—你最爱的美食</title>
<style type="text/css"><!--
a:link,a:visited{
text-decoration:none; /*超链接无下划线*/
}
a{color:black;}
a:hover{
text-decoration:underline;
}
.box {
margin:auto
height: 1000px;
width: 1300px;
height: auto;
}
.zuopiaofu {
float: right;
margin-right: 150px;
height: 260px;
width: 345px;
margin-top: 110px;
background-image: url(images/webbase/longin-right.gif);
border: 1px solid #F00;
background-repeat: no-repeat;
background-color: #FEFAFA;
}
.loginbotton {
margin-left: 60px;
margin-top: 10px;
}
.logintable {
margin-top: 68px;
left: 701px;
top: 63px;
}
.zuopianfutrue {
float: left;
margin-top: 70px;
margin-left: 50px;
}.bottom {
background-image: url(images/webbase/loginbotttombg.jpg);
height: 175px;
width: 1300px;
text-align: center;
}
.foot {
text-align: center;
display: block;
}
.main {
height: 977px;
width: 1300px;
text-align: center;
}
body {
background-image: url(images/webbase/loginbg.gif);
background-repeat: repeat;
}
</style></head>
<body>
<center>
<div class="box"><div class="main">
<div class="zuopianfutrue"><img src="images/webbase/login_left.jpg" width="393" height="300"></div>
<div class="zuopiaofu">
<form action="loginCheck.jsp" method="post" onSubmit="return onclickFun();">
<table width="342" height="106"class="logintable">
<tr>
<td width="103" height="52"> </td>
<td width="229" height="52"><input height="38" name="loginname" type="text" id="name" value="[email protected]"></td>
</tr>
<tr>
<td height="52"> </td>
<td><input height="38" type="password" id="pwd" name="password" value="123456"></td>
</tr>
</table>
<table>
<tr>
<td> <div class="loginbotton"> <center>
<input name="button" type="image" id="button" value="提交" src="images/webbase/login_button.gif" align="top">
</center> </div></td>
</tr><tr><td> <% String message=(String)request.getAttribute("message");
//String message1=(String)request.getParameter("m");
if(message!=null&&!message.equals("")){%>
<font color="red"><%=message%></font>
<%}
%><a href="register.jsp">注册</a></td></tr></table>
</form>
</div>
</div>
<div class="foot">
<tr>
<td height="20" > </td>
</tr>
<tr>
<td height="177" align="center">
<div class="bottom"><table width="1282" height="180" class="weibuziti"><tr>
<td width="539" height="63"></td>
<td width="720">首页 | 美食区 | 活动专区 | 关于我们 | 联系我们</td>
</tr>
<tr>
<td height="109"></td>
<td align="right" valign="top"><font color="black"><strong><a href="#top">↑<br>
回<br>
到<br>
顶<br>
部</a></strong></font></td>
</tr>
</table>
</div></td>
</tr></div></div>
</center>
<script type="text/javascript">
function onclickFun(){
var name=document.getElementById("name");
var pwd=document.getElementById("pwd");
if(!name.value||!pwd.value){alert("用户名或密码不能为空");return false; }
else{return true;}
}
onclickFun();
</script>
</body>
</html>