|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.olat.core.logging.LogDelegator
org.olat.core.defaults.dispatcher.ClassPathStaticDispatcher
public class ClassPathStaticDispatcher
Description:
Allows to register static mappers. Here you can create urls which are valid
for all users and can be cached by browsers. The delivered resources must be
static files in the _static directory of your code.
In mod-jk mode this static files can be delivered directly from apache or even from another file server
If you need global mappers that provide dynamic content, then you mus use the GlobalMapperRegistry.java
If you need urls that are only accessible for one user, use the MapperRegistry.java
Initial Date: 6.10.2008
| Constructor Summary | |
|---|---|
ClassPathStaticDispatcher(boolean copyStaticFilesConfig,
java.lang.String dispatcherPath)
Constructor, only used by spring. |
|
| Method Summary | |
|---|---|
void |
copyStaticClassPathFiles()
Helper method to copy all class path static files to the webapp/static/classpath/ directory for direct delivery via apache. |
MediaResource |
createClassPathStaticFileMediaResourceFor(java.lang.Class baseClass,
java.lang.String relPath)
Create a static class path media resource form a given base class |
MediaResource |
createClassPathStaticFileMediaResourceFor(java.lang.Package pakkage,
java.lang.String relPath)
Create a static class path media resource form a given package |
void |
execute(javax.servlet.http.HttpServletRequest hreq,
javax.servlet.http.HttpServletResponse hres,
java.lang.String pathInfo)
|
static ClassPathStaticDispatcher |
getInstance()
|
java.lang.String |
getMapperBasePath(java.lang.Class clazz)
Create a path for the _static directory for the given class. |
java.lang.String |
getMapperBasePath(java.lang.Class clazz,
boolean addVersionID)
Create a path for the _static directory for the given class. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassPathStaticDispatcher(boolean copyStaticFilesConfig,
java.lang.String dispatcherPath)
copyStaticFilesConfig - true: copy static files and deliver via StaticMediaDispatcher;
false: don't copy files and deliver from classpathdispatcherPath - : path where to dispatch files ( e.g. '/classpath/')| Method Detail |
|---|
public static ClassPathStaticDispatcher getInstance()
public java.lang.String getMapperBasePath(java.lang.Class clazz)
globalNameClass - class for the name of the mapper. the name of the
mapper is the name of the package name for this class
public java.lang.String getMapperBasePath(java.lang.Class clazz,
boolean addVersionID)
clazz - The package name of this class is used for the pathaddVersionID - true: the build version is added to the URL to force
browser reload the resource when releasing a new version; false:
don't add version (but allow browsers to cache even when resource
has changed). Only use false when really needed
public void execute(javax.servlet.http.HttpServletRequest hreq,
javax.servlet.http.HttpServletResponse hres,
java.lang.String pathInfo)
execute in interface Dispatcherhreq - hres -
public MediaResource createClassPathStaticFileMediaResourceFor(java.lang.Class baseClass,
java.lang.String relPath)
baseClass - relPath -
public MediaResource createClassPathStaticFileMediaResourceFor(java.lang.Package pakkage,
java.lang.String relPath)
baseClass - relPath -
public void copyStaticClassPathFiles()
This method should only be called once at startup. To speed up things it checks on the last modified date of the files and copies only new files.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||