public class ErrorStatusServlet extends GenericServlet
<servlet> <servlet-name>forbidden</servlet-name> <servlet-class>com.caucho.servlets.ErrorStatusServlet</servlet-class> <init> <status-code>403</status-code> <message>You cannot look at that.</message> </init> </servlet> <servlet-mapping url-pattern="*.properties" servlet-name="forbidden"/> <servlet-mapping url-pattern="/config/*" servlet-name="forbidden"/>
Constructor and Description |
---|
ErrorStatusServlet() |
Modifier and Type | Method and Description |
---|---|
void |
service(ServletRequest request,
ServletResponse response)
Service a request.
|
void |
setMessage(java.lang.String message)
The message to send, default is to send no message.
|
void |
setStatusCode(int code)
The status code to send, default 404 (Not Found).
|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log, toString
public void setStatusCode(int code)
public void setMessage(java.lang.String message)
public void service(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException
Servlet
service
simultaneously. Normally,
req
and res
will actually be
HttpServletRequest
and HttpServletResponse
classes.request
- request information. Normally servlets will cast this
to HttpServletRequest
response
- response information. Normally servlets will cast this
to HttpServletRequest
ServletException
java.io.IOException