JSP页面中alert没有提示
下面的代码帮帮忙谢谢啦<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"><html><head><base...
下面的代码 帮帮忙 谢谢啦
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'doIndex.jsp' starting page</title>
<%
request.setCharacterEncoding("utf-8");
String userName=request.getParameter("nameTxt");
String userPass=request.getParameter("passTxt");
UserDao userDao=new UserDaoImpl();
User user=userDao.selectUser(userName);
if(userName.equals(user.getUserName()) && userPass.equals(user.getUserPass())){
application.setAttribute("uName",userName);
response.sendRedirect("../message/ListMsg.jsp");
}else{
out.write("<script type='text/javascript' language='javascript'>if(confirm('请先注册')){");
response.sendRedirect("../message/reg.jsp");
out.write("}</script>");
}
%>
<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"> 展开
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'doIndex.jsp' starting page</title>
<%
request.setCharacterEncoding("utf-8");
String userName=request.getParameter("nameTxt");
String userPass=request.getParameter("passTxt");
UserDao userDao=new UserDaoImpl();
User user=userDao.selectUser(userName);
if(userName.equals(user.getUserName()) && userPass.equals(user.getUserPass())){
application.setAttribute("uName",userName);
response.sendRedirect("../message/ListMsg.jsp");
}else{
out.write("<script type='text/javascript' language='javascript'>if(confirm('请先注册')){");
response.sendRedirect("../message/reg.jsp");
out.write("}</script>");
}
%>
<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"> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询