Hi everybody,
I am trying to solve the following problem:
Subtle changes in a class produce sistematically
the followong error output, in a bean method call:
Error: 500
Location: /presenta/prueba/login.admin.jsp
Internal Servlet Error:
java.lang.IllegalStateException: Response has already been committed
at
org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletResponseFacade.java,
Compiled Code)
at
org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java,
Compiled Code)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java,
Compiled Code)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java,
Compiled Code)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
Renaming the class corrects the error.
The complete jsp is:
<%@ page import="db.DBAccess1" %>
<jsp:useBean id="DBAccessInstance" class="db.DBAccess1" />
<jsp:setProperty name="DBAccessInstance" property="*" />
<html>
<head><title>Pedazo de titulo</title></head>
<body>
<% if (DBAccessInstance.getKeyword().equals("noData")) { %>
noData
<% } else { %>
other value
<% } %>
</body>
</html>
the complete class code is:
package db;
public class DBAccess1 {
String keyword;
public DBAccess1() {
reset();
} //DBAccess
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public String getKeyword() {
return keyword;
}
public void reset() {
keyword = "noData";
}
} //class DBAccess
--
Thank you very much for your help and wise criticisms!
--------------------------
"El bit es al hombre lo que el �tomo a Dios"
Enrique P�rez Soler
mailto:[EMAIL PROTECTED]
http://ttt.teleco.upv.es/~enpeso
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets