Código:
INFORMACIÓN: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@1da60351') ago 21, 2015 12:49:41 PM org.apache.catalina.core.StandardWrapperValve invoke GRAVE: Servlet.service() para servlet ServletGetUsuario lanzó excepción java.lang.IllegalStateException: getWriter() ya ha sido llamado para esta respuesta at org.apache.catalina.connector.Response.getOutputStream(Response.java:644) at org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:196) at mx.uaem.servlet.ServletGetUsuario.processRequest(ServletGetUsuario.java:80) at mx.uaem.servlet.ServletGetUsuario.doPost(ServletGetUsuario.java:128) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2476) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2465) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) ago 21, 2015 12:52:15 PM org.apache.catalina.core.ApplicationContext log INFORMACIÓN: SessionListener: contextDestroyed()
Código Java:
Ver original
protected void processRequest(HttpServletRequest request, HttpServletResponse response) response.setContentType("application/pdf"); try { String noControlMatricula; String curp; curp = request.getParameter("curp"); noControlMatricula = request.getParameter("ncm"); ControlGetUsuario getUser; getUser = new ControlGetUsuario(); out.println(getUser.getUsuario(noControlMatricula, curp)); PdfWriter.getInstance(document, response.getOutputStream()); document.open(); document.add(new Paragraph("Nombre: " + getUser.getUsuario(noControlMatricula, curp).trim())); document.add(new Paragraph("Numero de control o matricula: " + noControlMatricula)); document.add(new Paragraph("CURP: " + curp)); } catch (DocumentException ex) { } finally { out.close(); } document.close(); }