public class WikiJSPFilter extends WikiServletFilter
Inclusion markers are placed by the IncludeResourcesTag; the default content templates (see .../templates/default/commonheader.jsp) are configured to do this. As an example, a JavaScript resource marker is added like this:
<wiki:IncludeResources type="script"/>Any code that requires special resources must register a resource request with the TemplateManager. For example:
<wiki:RequestResource type="script" path="scripts/custom.js" />or programmatically,
TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, "scripts/customresource.js" );
TemplateManager
,
RequestResourceTag
log, m_engine
Constructor and Description |
---|
WikiJSPFilter() |
Modifier and Type | Method and Description |
---|---|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
Checks that the WikiEngine is running ok, wraps the current
HTTP request, and sets the correct authentication state for the users's
WikiSession.
|
protected void |
fireEvent(int type,
String pagename)
Fires a WikiPageEvent of the provided type and page name
to all registered listeners of the current WikiEngine.
|
void |
init(javax.servlet.FilterConfig config)
Initializes the WikiServletFilter.
|
destroy, getWikiContext
public WikiJSPFilter()
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
init
in class WikiServletFilter
config
- The FilterConfig.javax.servlet.ServletException
- If a WikiEngine cannot be started.public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, IOException
WikiServletFilter
AuthenticationManager.login(HttpServletRequest)
executes, which sets the authentication state. Then, the request is wrapped with a
WikiRequestWrapper
.doFilter
in interface javax.servlet.Filter
doFilter
in class WikiServletFilter
request
- the current HTTP request objectresponse
- the current HTTP response objectchain
- The Filter chain passed down.javax.servlet.ServletException
- if AuthenticationManager.login(HttpServletRequest)
fails for any reasonIOException
- If writing to the servlet response fails.protected final void fireEvent(int type, String pagename)
type
- the event type to be firedpagename
- the wiki page name as a StringWikiPageEvent
Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.