Pramod, Tons of thanks for the reply. Your answers made me sure that i have to look for the problem in other areas. I still welcome any other ideas on this problem. By the way, i used <[EMAIL PROTECTED]> on my jsp pages. Thanks once again.
--- Pramod Nair <[EMAIL PROTECTED]> wrote: > > 1- Is each user has it's own instance of jsp page? > > For all practical purposes, you can consider that each user has an > "instance" of the JSP page > > > 2- Do I need to synchronized request.sendRedirect() in jsp page? > > That shouldn't be necessary > > > Also : > > Is this error happen because I used a jsp page "LoginServlet.jsp" for > > database invocation and event handling instead of a pure servlet? > > Ideally, your LoginServlet.jsp should have been a pure servlet, but > then, thats simply a design aesthetics point of view. It certainly shouldn't > cause an error. > > btw, Are you by any chance using the <%! %> tag or the <@page> directive in > your JSP code ? > > regards > > Pramod Nair > > ----- Original Message ----- > From: "Ali Chadorbaf" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, September 16, 2002 12:17 AM > Subject: unable to dispatch to requested page........request.sendRedirect() > ? > > > > Hi friends, > > I have a problem in my jsp application and would like to bring it to your > > attention, so you may see something that I didn't. > > > > Some info: > > I developed a jsp application using JDeveloper9i as IDE and deployed it on > > Oracle 9i Application server. This application is totally based on jsp > pages > > and no pure servlet is involved. But used java embedded code in jsp pages. > To > > worked as a servlet. > > This application works fine in single user environment but I saw a lot of > > errors like following when multi users invoke it. This errors some times > lock > > the entire application and application server no longer respond to > requests and > > has to be restart. > > > > Here is a type of error I saw in application server log file: > > > > 9/12/02 9:30 AM defaultWebApp: Internal error in sendError() > > java.lang.IllegalArgumentException: Attempted to write longer than > > Content-Length (0 + 1648 / 249) > > at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for > > > J2EE].server.http.EvermindServletOutputStream.write(EvermindServletOutputStr > eam.java:231) > > > > at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for > > > J2EE].server.http.EvermindServletOutputStream.write(EvermindServletOutputStr > eam.java:130) > > > > at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for > > > J2EE].server.http.EvermindHttpServletResponse.sendError(EvermindHttpServletR > esponse.java:1301) > > > > at > oracle.jsp.runtimev2.JspReportUtil.reportException(JspReportUtil.java:135) > > ..... > > ... > > 9/12/02 9:30 AM defaultWebApp: JspServlet: unable to dispatch to requested > > page: com.evermind.server.http.HttpIOException: Connection reset by peer: > > socket write error > > at > > > com.evermind.server.http.EvermindHttpServletResponse.commit(EvermindHttpServ > letResponse.java:673) > > > > at > > > com.evermind.server.http.EvermindHttpServletResponse.commitAndIgnoreWrites(E > vermindHttpServletResponse.java:212) > > > > at > > > com.evermind.server.http.EvermindHttpServletResponse.sendRedirect(EvermindHt > tpServletResponse.java:1347) > > > > at _AdminProject._site1._LoginServlet._jspService(_LoginServlet.java:95) > > at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) > > at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:180) > > ... > > ... > > > > Here i bring a simple example which handles a login page in this > application. > > That's include two jsp pages named "LoginScreen.jsp" and > "LoginServlet.jsp". > > "LoginServlet.jsp" processes the employee_id received from > "LoginScreen.jsp" > > and retrieves the profile from database and send the values to the screen > on > > "LoginScreen.jsp" .Also it sends and error if the employee_id is invalid. > > > > > > LoginServlet.jsp > > . > > .. > > <% > > HttpSession mySession = request.getSession(false); > > > > // get employee_id from screen > > String sEmpNo=request.getAttribute("emp"); > > String errMsg="'; > > ... > > .. > > // some database invocation are involve here > > // to validate employee_id and get his/her profile > > // if employee not found then errMsg="Employee not found" > > ... > > ... > > // put values on the session to send them on screen > > mySession.setAttribute("emp",sEmp); > > mySession.setAttribute("firstname",sFirstName); > > mySession.setAttribute("lastname",sLastName); > > > > //redirect to screen > > request.sendRedirect("LoginScreen.jsp?err="+errMsg); > > %> > > > > > > > > loginScreen.jsp > > . > > <!script> > > function showError(err){ > > if (err.length>0) alert(err); > > } > > <!/script> > > > > . > > .. > > <% > > HttpSession mySession = request.getSession(false); > > //Get values from the HttpSession and HttpRequest > > String sEmp=mySession.getAttribute("emp"); > > String sFirstname=mySession.getAttribute("firstname"); > > String sLastname=mySession.getAttribute("lastname"); > > String errMsg=request..getAttribute("err"); > > ... > > .. > > %> > > <html> > > <form name=frm> > > <body onload="showError(<%=errMsg%>)" > > .. > > You are successfully logged in: > > <input name="emp" value="<%=sEmp%>" /> > > <input name="first" value="<%=sFirstname%>" /> > > <input name="last" value="<%=sLastname%>" /> > > ... > > ... > > </form> > > </body> > > </html> > > > > > > > > Seems request.sendRedirect() cannot respond to multi users and this method > will > > fail if multi users at the same time invoke it. This problem brought me > some > > beginner questions: > > > > 1- Is each user has it's own instance of jsp page? > > 2- Do I need to synchronized request.sendRedirect() in jsp page? > > Also : > > Is this error happen because I used a jsp page "LoginServlet.jsp" for > > database invocation and event handling instead of a pure servlet? > > > > I totally lost on this and would appreciate to share me any idea that you > might > > have. > > > > Thanks a lot in advance. > > Ali > > > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! News - Today's headlines > > http://news.yahoo.com > > > > > ___________________________________________________________________________ > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the > body > === message truncated === __________________________________________________ Do you Yahoo!? Yahoo! News - Today's headlines http://news.yahoo.com ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html