One thing we would like to do in our application is disable verbose error messages (i.e. stack traces) in responses to the UI from the server. What is the recommended way of doing this?
For example, using the showcase, if I send the following request, where I include invalid XML:
I get this response:
For example, using the showcase, if I send the following request, where I include invalid XML:
I get this response:
Code:
HTTP/1.1 200 OK Date: Thu, 22 Dec 2016 21:45:38 GMT Server: Apache-Coyote/1.1 Content-Type: text/html; charset=UTF-8 Content-Length: 4118 Set-Cookie: JSESSIONID=026B0F75BB1E406168438CD0E7AFFB9E; Path=/showcase; HttpOnly Connection: close com.isomorphic.xml.XMLParsingException: [<BR> "XML parser fatal error: file '(in memory stream)' line 1: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 245; The content of elements must consist of well-formed character data or markup."<BR>]<BR> at com.isomorphic.xml.XML.parseXML(XML.java:288)<BR> at com.isomorphic.xml.XML.parseRestrictedXML(XML.java:148)<BR> at com.isomorphic.xml.XML.toDSRecords(XML.java:431)<BR> at com.isomorphic.xml.XML.toDSRecords(XML.java:427)<BR> at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:2213)<BR> at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:369)<BR> at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:349)<BR> at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:147)<BR> at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)<BR> at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)<BR> at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)<BR> at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:162)<BR> at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)<BR> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)<BR> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)<BR> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)<BR> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)<BR> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)<BR> at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)<BR> at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:88)<BR> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)<BR> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)<BR> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)<BR> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)<BR> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)<BR> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)<BR> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)<BR> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)<BR> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)<BR> at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104)<BR> at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)<BR> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)<BR> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)<BR> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)<BR> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)<BR> at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)<BR> at java.lang.Thread.run(Thread.java:745)<BR>
Comment