遇到一个非常郁闷的问题,在tomcat6下没有问题,到了tomcat5.5下出现问题了,问题如下:
一个检查用户信息的页面check.jsp,并且如果信息正确将重定向到主页.
<%@ page contentType="text/html;charset=gb2312" language="java" import="java.sql.*" errorPage=""%>
<jsp:useBean id="condb" scope="page" class="conbean.ConBean"/>
<%
//获取前台登陆信息(姓名、密码)
String user_n=String.valueOf(session.getAttribute("user_name"));
String pass_w=String.valueOf(session.getAttribute("pass_word"));
//if(user_n!=null&&pass_w!=null)
// {
condb.getConnection();
ResultSet rs=condb.executeQuery("SELECT * FROM adminlogin WHERE adminname='"+user_n+"'AND password='"+pass_w+"'");
if(rs.next()){
response.sendRedirect("index.jsp");
}
// else{
// out.print("<script>location.href='error.jsp'</script>");
// }
// }
// else
// {
// out.print("<script>location.href='error.jsp'</script>");
// }
%>
上面的姓名 密码都能获取到,就是到了 response.sendRedirect("index.jsp");它不执行,页面一直是check.jsp,空白页面,我把response.sendRedirect("index.jsp")换成打印输出信息,还是空白页面,测试了很多,好像只要出现rs.next(),它就有问题,它怎么就不能跳转到index.jsp了呢?
查看log信息,出现下面信息:
2007-11-4 2:19:08 org.apache.catalina.core.ApplicationContext log
信息: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
2007-11-4 2:19:08 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2007-11-4 2:19:08 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2007-11-4 2:19:08 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2007-11-4 2:19:08 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()在tomcat6.0下没有出现这种问题,到了tomcat5.5下就这样了,哎,郁闷,不知道怎么回事,大侠们,帮帮忙吧!不胜感激!
一个检查用户信息的页面check.jsp,并且如果信息正确将重定向到主页.
<%@ page contentType="text/html;charset=gb2312" language="java" import="java.sql.*" errorPage=""%>
<jsp:useBean id="condb" scope="page" class="conbean.ConBean"/>
<%
//获取前台登陆信息(姓名、密码)
String user_n=String.valueOf(session.getAttribute("user_name"));
String pass_w=String.valueOf(session.getAttribute("pass_word"));
//if(user_n!=null&&pass_w!=null)
// {
condb.getConnection();
ResultSet rs=condb.executeQuery("SELECT * FROM adminlogin WHERE adminname='"+user_n+"'AND password='"+pass_w+"'");
if(rs.next()){
response.sendRedirect("index.jsp");
}
// else{
// out.print("<script>location.href='error.jsp'</script>");
// }
// }
// else
// {
// out.print("<script>location.href='error.jsp'</script>");
// }
%>
上面的姓名 密码都能获取到,就是到了 response.sendRedirect("index.jsp");它不执行,页面一直是check.jsp,空白页面,我把response.sendRedirect("index.jsp")换成打印输出信息,还是空白页面,测试了很多,好像只要出现rs.next(),它就有问题,它怎么就不能跳转到index.jsp了呢?
查看log信息,出现下面信息:
2007-11-4 2:19:08 org.apache.catalina.core.ApplicationContext log
信息: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
2007-11-4 2:19:08 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2007-11-4 2:19:08 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2007-11-4 2:19:08 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2007-11-4 2:19:08 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()在tomcat6.0下没有出现这种问题,到了tomcat5.5下就这样了,哎,郁闷,不知道怎么回事,大侠们,帮帮忙吧!不胜感激!
解决方案 »
- JSP jstl 乱码问题
- 运行时The module has not been deployed.报错
- 跪求!!!着急啊谁能帮我解答下
- 有谁懂stripes+spring+hibernate的!!进来~在线等
- 我将spring2.0 +hibernate3.0以前用的代码移植到最新版的spring2.5 +hibernate3.2后出现的错误,谁能帮忙,谢谢。
- JDBC begin failed
- 一个jsp数据库查询问题!
- WEB-XML
- 关于JSP连接数据库超慢的问题,在线等,解答就给分!
- 请各位帮忙了
- 防止相同窗口内页面刷新的问题!
- 一个关于Action线程安全的问题,大侠帮我看看,定给分!
{
out.print(r.getString("adminname") + "<br>");
out.print(r.getString("password"));
}用上面的语句,我现在想要把登录信息输出,但还是那样,到了这个页面,就空白了,什么都没有,
然后
{
out.print(rs.getString( "adminname ") + " <br> ");
out.print(rs.getString( "password "));
}
用上面的语句,我现在想要把登录信息输出,但还是那样,到了这个页面,就空白了,什么都没有,
然后