no.sesat.search.http.filters
Class SiteJspLoaderFilter

java.lang.Object
  extended by no.sesat.search.http.filters.SiteJspLoaderFilter
All Implemented Interfaces:
Filter

public final class SiteJspLoaderFilter
extends Object
implements Filter

Downloads JSP files from skins into sesat to be compiled and used locally. This makes it look like jsps from the other skin web applications actually are bundled into sesat.

Implementation issue: Design and code with JSPs in skins

Inclusion of jsps may occurr with <jsp:include page="..."/> or some other requestDispatcher.include(..) approach. <%@ include file=".."/%> will not work.

To enable JSP files in a particular skin to be downloaded into sesat the following configuration is required:

This have already been done in the base skin sesat-kernel/generic.sesam and can be used as an example.

Tomcat, or the container used, must not use unpackWARs="false", or any non-file based deployment implementation, as this class must be able to write files into the deployed webapps directory.
Such files are written using a FileChannel obtained like
new RandomFileAccess(new File(root + "requested-jsp-name"),"rw").getChannel()

Version:
$Id: SiteJspLoaderFilter.java 7225 2009-04-09 00:32:20Z ssmiweve $

Field Summary
static String INC_SERVLET_PATH
          Servlet context and request attributes that the JSP engine uses.
static String JSP_FILE
          Request attribute for <jsp-file> element of a servlet definition.
 
Constructor Summary
SiteJspLoaderFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
           
 void init(FilterConfig filterConfig)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JSP_FILE

public static final String JSP_FILE
Request attribute for <jsp-file> element of a servlet definition. If present on a request, this overrides the value returned by request.getServletPath() to select the JSP page to be executed.


INC_SERVLET_PATH

public static final String INC_SERVLET_PATH
Servlet context and request attributes that the JSP engine uses.

See Also:
Constant Field Values
Constructor Detail

SiteJspLoaderFilter

public SiteJspLoaderFilter()
Method Detail

init

public void init(FilterConfig filterConfig)
          throws ServletException
Specified by:
init in interface Filter
Throws:
ServletException

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException

destroy

public void destroy()
Specified by:
destroy in interface Filter


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.