|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.2) E14255-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.bea.p13n.servlets.SendErrorServlet
public class SendErrorServlet
This servlet simply sends an error code. The only reason you might need such a thing is to override a servlet that has been deployed in a Library Module. Due to the way descriptor merging works for web.xml, you can not "turn off" a servlet which is deployed in a library's web.xml. There is not anything available in your web app's web.xml to turn such a servlet off. Therefore, the only thing you can do is override the servlet with one that sends errors (usually 404, which is what this servlet does. This servlet understands one optional init parameter named "errorCode", which should be an integer for the code this servlet should send. It defaults to 404. <p/> For example, maybe a library module contains a servlet such as:
<servlet> <servlet-name>SomeServlet</servlet-name> <servlet-class>org.foo.TheServlet</servlet-class> </servlet>
You can override this in your application's web.xml using the same servlet-name, like this:
<servlet> <servlet-name>SomeServlet</servlet-name> <servlet-class>com.bea.p13n.servlets.SendErrorServlet</servlet-class> </servlet>
Constructor Summary | |
---|---|
SendErrorServlet() |
Method Summary | |
---|---|
void |
init() Initializes the error code from the "errorCode" init param, if set (otherwise, defaults to 404). |
void |
service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Calls response.sendError( errorCode), where errorCode is specified by the "errorCode" init param (which defaults to 404). |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SendErrorServlet()
Method Detail |
---|
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
service
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.2) E14255-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2010, Oracle. All rights reserved.