* Implement suppressErrorPage property to allow error pages
for low level errors to be suppressed: suppressErrorPage = true
This commit is contained in:
parent
a21d31830e
commit
1650407241
2 changed files with 21 additions and 17 deletions
|
@ -541,6 +541,7 @@ public final class ResponseTrans extends Writer implements Serializable {
|
||||||
writeXmlRpcError(new RuntimeException(message));
|
writeXmlRpcError(new RuntimeException(message));
|
||||||
} else {
|
} else {
|
||||||
status = 500;
|
status = 500;
|
||||||
|
if (!"true".equalsIgnoreCase(app.getProperty("suppressErrorPage"))) {
|
||||||
write("<html><body><h3>");
|
write("<html><body><h3>");
|
||||||
write("Error in application ");
|
write("Error in application ");
|
||||||
write(appName);
|
write(appName);
|
||||||
|
@ -549,6 +550,7 @@ public final class ResponseTrans extends Writer implements Serializable {
|
||||||
write("</body></html>");
|
write("</body></html>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void writeXmlRpcResponse(Object result) {
|
public void writeXmlRpcResponse(Object result) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -366,6 +366,7 @@ public abstract class AbstractServletClient extends HttpServlet {
|
||||||
response.setStatus(code);
|
response.setStatus(code);
|
||||||
response.setContentType("text/html");
|
response.setContentType("text/html");
|
||||||
|
|
||||||
|
if (!"true".equalsIgnoreCase(getApplication().getProperty("suppressErrorPage"))) {
|
||||||
Writer writer = response.getWriter();
|
Writer writer = response.getWriter();
|
||||||
|
|
||||||
writer.write("<html><body><h3>");
|
writer.write("<html><body><h3>");
|
||||||
|
@ -380,6 +381,7 @@ public abstract class AbstractServletClient extends HttpServlet {
|
||||||
writer.write("</body></html>");
|
writer.write("</body></html>");
|
||||||
writer.flush();
|
writer.flush();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void sendRedirect(HttpServletRequest req, HttpServletResponse res, String url) {
|
void sendRedirect(HttpServletRequest req, HttpServletResponse res, String url) {
|
||||||
String location = url;
|
String location = url;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue