I have this bean:
public String voeg(){
String message = "hallo";
try {
String query = "INSERT INTO klant (naam) VALUES (Jakke)";
Class.forName(driver);
connection = DriverManager.getConnection(url);
statement = connection.createStatement();
statement.executeUpdate(query);
statement.close();
connection.close();
}
catch (SQLException e){
message = e.getMessage();
}
catch (ClassNotFoundException cnfex){}
return message;
}
this jsp file:
<%@ page language="java" %>
<%@ page import="databank" %>
<jsp:useBean id="db" class="databank" />
<%
String resultaat = db.voeg();
%>
<%= resultaat %>
and this error:
Error: 500
Location: /test4.jsp
Internal Servlet Error:
java.lang.IllegalStateException: Response has already been committed
at
org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletResponseFacade.java:157)
at
org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java:299)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Unknown Source)
What is wrong because I don't find it
thanks in advance
Jonas
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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