ASF Bugzilla – Attachment 15446 Details for
Bug 35393
errorReportValveClass not found
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Java source file as testcase
MyErrorValve.java (text/plain), 1.97 KB, created by
bernard
on 2005-06-17 08:09:04 UTC
(
hide
)
Description:
Java source file as testcase
Filename:
MIME Type:
Creator:
bernard
Created:
2005-06-17 08:09:04 UTC
Size:
1.97 KB
patch
obsolete
>package mypackage; > >import java.io.IOException; >import javax.servlet.ServletException; >import javax.servlet.ServletRequest; >import javax.servlet.ServletResponse; >import javax.servlet.http.HttpServletResponse; >import org.apache.catalina.connector.Request; >import org.apache.catalina.connector.Response; >import org.apache.catalina.Globals; >import org.apache.catalina.valves.ValveBase; > >public class MyErrorValve extends ValveBase{ > > > /** > * Invoke the next Valve in the sequence. When the invoke returns, check > * the response state, and output an error report is necessary. > * > * @param request The servlet request to be processed > * @param response The servlet response to be created > * > * @exception IOException if an input/output error occurs > * @exception ServletException if a servlet error occurs > */ > public void invoke(Request request, Response response) > throws IOException, ServletException { > > // Perform the request > getNext().invoke(request, response); > > ServletRequest sreq = (ServletRequest) request; > Throwable throwable = > (Throwable) sreq.getAttribute(Globals.EXCEPTION_ATTR); > > ServletResponse sresp = (ServletResponse) response; > if (sresp.isCommitted()) { > return; > } > > if (throwable != null) { > > // The response is an error > response.setError(); > > // Reset the response (if possible) > try { > sresp.reset(); > } catch (IllegalStateException e) { > ; > } > > response.sendError > (HttpServletResponse.SC_INTERNAL_SERVER_ERROR); > > } > > response.setSuspended(false); > >// The difference from ErrorReportValve is that we don't return a report >// in the response. >// try { >// report(request, response, throwable); >// } catch (Throwable tt) { >// tt.printStackTrace(); >// } > > } > > > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 35393
: 15446 |
15447