50 Ask a mysterious JSP validation login issues plus 50 minutes is not enough, go back inside after never again CSDN mix!!!!

Category: Web Develop
 
dd41dd41
2010-09-29 02:02:47

Sponsored Links
Previously done an authentication login JSP, processing data from the front desk sent me, has been fine, but recently there always this error:

exception java.lang.IllegalStateException
org.apache.coyote.tomcat5.CoyoteResponseFacade.sendRedirect (CoyoteResponseFacade.java: 352)
org.apache.jsp.checkLogOn_jsp._jspService (checkLogOn_jsp.java: 104)
org. apache.jasper.runtime.HttpJspBase.service (HttpJspBase.java: 94)
javax.servlet.http.HttpServlet.service (HttpServlet.java: 802)
org.apache.jasper. servlet.JspServletWrapper.service (JspServletWrapper.java: 324)
org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java: 292)
org.apache.jasper.servlet. JspServlet.service (JspServlet.java: 236)
javax.servlet.http.HttpServlet.service (HttpServlet.java: 802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs.Apache Tomcat/5.0.27

Sponsored Links

ly520988
2010-09-29 02:14:00
landlord in operation when the database does not like to use try {} catch ( SQLException ex) {} of it? How it will be not being given
leegroup
2010-09-29 02:28:44
landlord tried to abnormal catch live, JSP page packet errors are not easy to debug, debugging using the console might be able to see where the problem lies.
Z15807650273
2010-09-29 02:46:13
Yes, say the best is not usually write jsp exception, but when debugging why not?
hotbbq
2010-09-29 02:56:43
debug information in the code to run
see where to throw the wrong
xb86917
2010-09-29 03:10:33
is not only judged successful steering, if the login is unsuccessful it?
zengke689
2010-09-29 03:24:24
LOGS inside view information in greater detail.
ohmyfuc_k
2010-09-29 03:42:38
processing JSP main part is this:

request.setCharacterEncoding ("gb2312"); / / avoid garbled
/ / -------------------------------------------------- ---------------------------------
String userLogOnName = request. getParameter ("userLogOnName"). trim (); / / get the page, enter the user name
String pwd = request.getParameter ("pwd"); / / / get the page to enter the password
String selectType = request.getParameter ("selectType"); / / get the page to select the type of login
String userName = ""; / / Predefined be obtained from the database user name
int userId = 0;
int userVisit = 0; / / Predefined be obtained from the database user login times
/ / ------------- -------------------------------------------------- --------------------
Connection con = handleDatabase.connect (); / / establish a connection with the database
/ / ----------------------------------------- ------------------------------------------
if (selectType.equals ("teacher")) {/ / If a teacher login
PreparedStatement ps1 = con.prepareStatement (" SELECT te_visit, te_name, te_id FROM teacher WHERE te_usr =? and te_pwd =? "); / / will enter the user name and password in the database carried out, and returns the user name and access time
ps1.setString (1, userLogOnName);
ps1.setString ( 2, pwd);
ResultSet result1 = ps1.executeQuery ();
/ / ---- -------------------------------------------------- -----------------------------
if (result1.next ()) {
userVisit = result1.getInt ("te_visit") + 1; / / add a user visits
userName = result1.getString ("te_name");
userId = result1.getInt ("te_id");
result1.close ();
ps1.close ();
PreparedStatement ps2 = con.prepareStatement ("update teacher set te_visit =? where te_usr = ? "); / / returns the number of visits to the latest database
ps2.setInt (1, userVisit);
; ps2.setString (2, userLogOnName);
ps2.execute ();
ps2.close ();
con.close ();
session.setAttribute ("userName", userName); / / the user name and the user types into the session
session.setAttribute (" ; type ", selectType);
session.setAttribute (" userId ", new Integer (userId));
String visitNo = Integer.toString (userVisit);
session.setAttribute ("visitNo", ; visitNo);
session.setAttribute ("isLog", new String ("1")); / / login sign of success
response.sendRedirect ("lookAwardInfo.jsp");

}

problem lies in the response . sendRedirect ("lookAwardInfo.jsp"); This is a on ... Do not know what's wrong?? should be that way Ah, but errors are when you first log on, log in again and it is normal the
huyc139
2010-09-29 03:47:59
sorry ha, school yesterday, not on the net, I would like to ask JB 2005 in where to look LOG information
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.