fc.web.servlet
Class PathServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
fc.web.servlet.PathServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
public abstract class PathServlet
- extends javax.servlet.http.HttpServlet
A convenient base class for servlets that use path info (must
be path mapped; extension mapped servlets (like *.mp) do not
have any path info associated with them.
If the request has a non-null non-empty path, then that path
is sent to the doPathInfo
method, which
a subclass should implement. A request with an empty or null
path info results in sending a 404 error back to the client.
- See Also:
- Serialized Form
Method Summary |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
abstract void |
doPathInfo(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.lang.String pathinfo)
The pathinfo parameter is not intern()'ed but can be
if/as needed in this method. |
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
void |
error(javax.servlet.http.HttpServletResponse res,
java.lang.String msg)
Sends a 404 (page not found) error to the client. |
void |
init(javax.servlet.ServletConfig conf)
|
Methods inherited from class javax.servlet.http.HttpServlet |
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 |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PathServlet
public PathServlet()
init
public void init(javax.servlet.ServletConfig conf)
throws javax.servlet.ServletException
- Specified by:
init
in interface javax.servlet.Servlet
- Overrides:
init
in class javax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
doPost
public void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
- Overrides:
doPost
in class javax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
java.io.IOException
doGet
public void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
- Overrides:
doGet
in class javax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
java.io.IOException
error
public void error(javax.servlet.http.HttpServletResponse res,
java.lang.String msg)
throws java.io.IOException
- Sends a 404 (page not found) error to the client. Invoke
this method if there is missing/bad path info and return
from the servlet.
- Throws:
java.io.IOException
doPathInfo
public abstract void doPathInfo(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.lang.String pathinfo)
throws javax.servlet.ServletException,
java.io.IOException
- The pathinfo parameter is not intern()'ed but can be
if/as needed in this method.
- Throws:
javax.servlet.ServletException
java.io.IOException