public abstract class PathServlet extends HttpServlet
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.
Constructor and Description |
---|
PathServlet() |
Modifier and Type | Method and Description |
---|---|
void |
doGet(HttpServletRequest req,
HttpServletResponse res) |
abstract void |
doPathInfo(HttpServletRequest req,
HttpServletResponse res,
java.lang.String pathinfo)
The pathinfo parameter is not intern()'ed but can be
if/as needed in this method.
|
void |
doPost(HttpServletRequest req,
HttpServletResponse res) |
void |
error(HttpServletResponse res,
java.lang.String msg)
Sends a 404 (page not found) error to the client.
|
void |
init(ServletConfig conf) |
service
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
public PathServlet()
public void init(ServletConfig conf) throws ServletException
init
in interface Servlet
init
in class GenericServlet
ServletException
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, java.io.IOException
doPost
in class HttpServlet
ServletException
java.io.IOException
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, java.io.IOException
doGet
in class HttpServlet
ServletException
java.io.IOException
public void error(HttpServletResponse res, java.lang.String msg) throws java.io.IOException
java.io.IOException
public abstract void doPathInfo(HttpServletRequest req, HttpServletResponse res, java.lang.String pathinfo) throws ServletException, java.io.IOException
ServletException
java.io.IOException