|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.riotfamily.cachius.spring.AbstractCacheableController
org.riotfamily.website.txt2img.Txt2ImgController
public class Txt2ImgController
Field Summary |
---|
Fields inherited from interface org.riotfamily.cachius.spring.CacheableController |
---|
CACHE_ETERNALLY |
Constructor Summary | |
---|---|
Txt2ImgController()
|
Method Summary | |
---|---|
protected void |
appendCacheKey(StringBuffer key,
HttpServletRequest request)
Subclasses may overwrite this method to append values to the cache-key. |
protected String |
getEncodedParam(HttpServletRequest request,
String name)
|
long |
getLastModified(HttpServletRequest request)
The default implementation returns System.currentTimeMillis() so that the item is
refreshed as soon as it expires. |
protected Locale |
getLocale(HttpServletRequest request)
Returns the locale for the given request. |
protected String |
getText(HttpServletRequest request)
Returns the text to be rendered. |
boolean |
gzipResponse(HttpServletRequest request)
Returns whether the response should be gzipped. |
ModelAndView |
handleRequest(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
serveImage(String text,
HttpServletRequest request,
HttpServletResponse response)
Serves an image containing the given text. |
protected void |
servePixelGif(HttpServletResponse response)
Serves a transparent 1x1 pixel GIF that is needed by the JavaScript to work around the PNG loading in IE < 7. |
protected void |
serveScript(HttpServletRequest request,
HttpServletResponse response)
Serves a JavaScript file that can be used to replace texts on the client side. |
protected void |
serveStyleSheet(HttpServletRequest request,
HttpServletResponse response)
|
void |
setApplicationContext(ApplicationContext applicationContext)
|
void |
setCompressor(YUIJavaScriptCompressor compressor)
|
void |
setRefererPattern(Pattern refererPattern)
Sets a regular expression that is used to check the Referer header. |
Methods inherited from class org.riotfamily.cachius.spring.AbstractCacheableController |
---|
bypassCache, getBeanName, getCacheKey, getCacheKeyInternal, getTimeToLive, setAddUriToCacheKey, setBeanName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Txt2ImgController()
Method Detail |
---|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
public void setCompressor(YUIJavaScriptCompressor compressor)
compressor
- the compressor to setprotected void appendCacheKey(StringBuffer key, HttpServletRequest request)
AbstractCacheableController
appendCacheKey
in class AbstractCacheableController
AbstractCacheableController.getCacheKeyInternal(HttpServletRequest)
public boolean gzipResponse(HttpServletRequest request)
Compressible
true
, unless they serve multiple content
types which and not all of them are eligible for compression. They
don't have to check whether the client supports gzip
compression as all compatibility checks are done by Cachius
internally
.
gzipResponse
in interface Compressible
public long getLastModified(HttpServletRequest request)
AbstractCacheableController
System.currentTimeMillis()
so that the item is
refreshed as soon as it expires. Subclasses should override this
method to return something reasonable.
getLastModified
in interface CacheableController
getLastModified
in interface LastModified
getLastModified
in class AbstractCacheableController
public void setRefererPattern(Pattern refererPattern)
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception
handleRequest
in interface Controller
Exception
protected Locale getLocale(HttpServletRequest request)
protected String getEncodedParam(HttpServletRequest request, String name)
protected String getText(HttpServletRequest request)
protected void serveImage(String text, HttpServletRequest request, HttpServletResponse response) throws IOException
IOException
protected void serveScript(HttpServletRequest request, HttpServletResponse response) throws IOException
IOException
protected void serveStyleSheet(HttpServletRequest request, HttpServletResponse response) throws IOException
IOException
protected void servePixelGif(HttpServletResponse response) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |