|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.struts2.dispatcher.DefaultStaticContentLoader
public class DefaultStaticContentLoader
| Field Summary | |
|---|---|
protected java.lang.String |
encoding
Store state of StrutsConstants.STRUTS_I18N_ENCODING setting. |
protected java.util.Calendar |
lastModifiedCal
Provide a formatted date for setting heading information when caching static content. |
protected java.lang.String[] |
pathPrefixes
Store set of path prefixes to use with static resources. |
protected boolean |
serveStatic
Store state of StrutsConstants.STRUTS_SERVE_STATIC_CONTENT setting. |
protected boolean |
serveStaticBrowserCache
Store state of StrutsConstants.STRUTS_SERVE_STATIC_BROWSER_CACHE setting. |
| Constructor Summary | |
|---|---|
DefaultStaticContentLoader()
|
|
| Method Summary | |
|---|---|
protected java.lang.String |
buildPath(java.lang.String name,
java.lang.String packagePrefix)
|
boolean |
canHandle(java.lang.String resourcePath)
|
protected java.lang.String |
cleanupPath(java.lang.String path)
|
protected void |
copy(java.io.InputStream input,
java.io.OutputStream output)
Copy bytes from the input stream to the output stream. |
protected java.net.URL |
findResource(java.lang.String path)
Look for a static resource in the classpath. |
void |
findStaticResource(java.lang.String path,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Locate a static resource and copy directly to the response, setting the appropriate caching headers. |
protected java.lang.String |
getAdditionalPackages()
|
protected java.lang.String |
getContentType(java.lang.String name)
Determine the content type for the resource name. |
protected java.lang.String[] |
parse(java.lang.String packages)
Create a string array from a comma-delimited list of packages. |
protected void |
process(java.io.InputStream is,
java.lang.String path,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
void |
setEncoding(java.lang.String val)
Modify state of StrutsConstants.STRUTS_I18N_ENCODING setting. |
void |
setHostConfig(HostConfig filterConfig)
|
void |
setServeStaticBrowserCache(java.lang.String val)
Modify state of StrutsConstants.STRUTS_SERVE_STATIC_BROWSER_CACHE setting. |
void |
setServeStaticContent(java.lang.String val)
Modify state of StrutsConstants.STRUTS_SERVE_STATIC_CONTENT setting. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String[] pathPrefixes
protected boolean serveStatic
protected boolean serveStaticBrowserCache
protected final java.util.Calendar lastModifiedCal
protected java.lang.String encoding
| Constructor Detail |
|---|
public DefaultStaticContentLoader()
| Method Detail |
|---|
public void setServeStaticContent(java.lang.String val)
val - New settingpublic void setServeStaticBrowserCache(java.lang.String val)
val - New settingpublic void setEncoding(java.lang.String val)
val - New settingpublic void setHostConfig(HostConfig filterConfig)
setHostConfig in interface StaticContentLoaderfilterConfig - The filter configurationprotected java.lang.String getAdditionalPackages()
protected java.lang.String[] parse(java.lang.String packages)
packages - A comma-delimited String listing packages
public void findStaticResource(java.lang.String path,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException
StaticContentLoader
findStaticResource in interface StaticContentLoaderpath - The resource namerequest - The requestresponse - The response
java.io.IOException - If anything goes wrong
protected void process(java.io.InputStream is,
java.lang.String path,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException
java.io.IOException
protected java.net.URL findResource(java.lang.String path)
throws java.io.IOException
path - The resource path
java.io.IOException - If there is a problem locating the resource
protected java.lang.String buildPath(java.lang.String name,
java.lang.String packagePrefix)
throws java.io.UnsupportedEncodingException
name - resource namepackagePrefix - The package prefix to use to locate the resource
java.io.UnsupportedEncodingException
java.io.IOExceptionprotected java.lang.String getContentType(java.lang.String name)
name - The resource name
protected void copy(java.io.InputStream input,
java.io.OutputStream output)
throws java.io.IOException
input - The input streamoutput - The output stream
java.io.IOException - If anything goes wrongpublic boolean canHandle(java.lang.String resourcePath)
canHandle in interface StaticContentLoaderresourcePath - Requested resource path
protected java.lang.String cleanupPath(java.lang.String path)
path - requested path
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||