请求如果是AJAX则跳转失效,需要用浏览器普通的请求访问才起作用。
解决方案 »
- 关于FckEdit。。
- jsp页面数据,插入mysql5.0时有乱码
- 连接SQL SERVER2005出错
- 在jsp中加入urlrewrite后FCKeditor无法使用应该怎么解决?
- 代码,用JSP向oracle数据库存取blob类型照片,帮忙看看.
- javax.servlet.ServletException: Communication failure during handshake. Is there a server running on 127.0.01:3306?
- 关于使用JFreeChart生成柱状图的问题,各位大侠帮帮我!急!!!代码如下。
- 分钟计时器。。在线等
- 如何写一个filter来tirm客户端post过来的数据?
- 关于HttpSessionListener
- 只学了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>