com.arsdigita.web
Class ApplicationFileServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.arsdigita.web.BaseServlet
com.arsdigita.web.BaseApplicationServlet
com.arsdigita.web.ApplicationFileServlet
- All Implemented Interfaces:
- Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- public class ApplicationFileServlet
- extends BaseApplicationServlet
A simple servlet for dispatching abstract URLs
to concrete JSP files.
This is intended to be used in all places where BebopMapServlet would
have traditionally been used, since it allows projects to override the
JSP at a particular location & add additional JSPs at new URLs without
Java code changes.
The application should set its web.xml to contain
<web-app>
<servlet>
<servlet-name>files</servlet-name>
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
<init-param>
<param-name>template-path</param-name>
<param-value>/templates/ccm-mywebapp</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>files</servlet-name>
<url-pattern>/files/*</url-pattern>
</servlet-mapping>
</web-app>
In the Application class it should define:
public String getContextPath() {
return "ccm-mywebapp";
}
public String getServletPath() {
return "/files";
}
It can then put JSP files in a 'templates/ccm-mywebapp' directory at
the root of its private webapp. Files in this directory can be scoped by
application URL stub, so a link to
/ccm/myparentapp/myappinstance/foo.jsp
gets resolved to
/templaates/myparentapp/myappinstance/foo.jsp
/templates/myparentapp/foo.jsp
/templates/foo.jsp
until one matches.
- See Also:
- Serialized Form
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
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 |
ApplicationFileServlet
public ApplicationFileServlet()
init
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
- Specified by:
init
in interface javax.servlet.Servlet
- Overrides:
init
in class BaseServlet
- Throws:
javax.servlet.ServletException
doService
protected void doService(javax.servlet.http.HttpServletRequest sreq,
javax.servlet.http.HttpServletResponse sresp,
Application app)
throws javax.servlet.ServletException,
IOException
- Description copied from class:
BaseApplicationServlet
The method that BaseApplicationServlet.doService(HttpServletRequest,HttpServletResponse)
calls.
Servlet authors should implement this method to perform
application-specific request handling.
- Specified by:
doService
in class BaseApplicationServlet
- Throws:
javax.servlet.ServletException
IOException
- See Also:
HttpServlet.service(HttpServletRequest,HttpServletResponse)
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC