Groovy Documentation

org.grails.plugin.resources.stash
[Java] Class StashManager

java.lang.Object
  org.grails.plugin.resources.stash.StashManager

public class StashManager

Manages the stashing and unstashing of page fragments.

Authors:
Patrick Jungermann


Field Summary
static java.lang.String REQ_ATTR_PREFIX_PAGE_FRAGMENTS

Prefix used for storing page fragment stashes.

static java.util.Map STASH_WRITERS

Registered, usable stash writers.

 
Constructor Summary
StashManager()

 
Method Summary
private static java.util.List consumePageFragments(javax.servlet.http.HttpServletRequest request, java.lang.String type, java.lang.String disposition)

Returns the stash (all page fragments) of the requested type and disposition.

private static java.lang.String makePageFragmentKey(java.lang.String type, java.lang.String disposition)

Returns the page fragment key, used to store the page fragment stashes.

static void stashPageFragment(javax.servlet.http.HttpServletRequest request, java.lang.String type, java.lang.String disposition, java.lang.String fragment)

Stashes a page fragment.

static void unstashPageFragments(java.io.Writer out, javax.servlet.http.HttpServletRequest request, java.lang.String disposition)

Unstashes the disposition's page fragments.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

REQ_ATTR_PREFIX_PAGE_FRAGMENTS

public static final java.lang.String REQ_ATTR_PREFIX_PAGE_FRAGMENTS
Prefix used for storing page fragment stashes.


STASH_WRITERS

public static final java.util.Map STASH_WRITERS
Registered, usable stash writers.


 
Constructor Detail

StashManager

StashManager()


 
Method Detail

consumePageFragments

@java.lang.SuppressWarningsprivate static List consumePageFragments(final HttpServletRequest request, final String type, final String disposition) {
private static java.util.List consumePageFragments(javax.servlet.http.HttpServletRequest request, java.lang.String type, java.lang.String disposition)
Returns the stash (all page fragments) of the requested type and disposition.
Parameters:
request - The request, at which the fragments have been stashed.
type - The fragments' type.
disposition - The disposition, for which the fragments have to be returned.
Returns:
All fragments of the requested type and disposition.


makePageFragmentKey

private static java.lang.String makePageFragmentKey(java.lang.String type, java.lang.String disposition)
Returns the page fragment key, used to store the page fragment stashes.
Parameters:
type - The fragments' type.
disposition - The fragments' disposition.
Returns:
The page fragment key.


stashPageFragment

@java.lang.SuppressWarningspublic static void stashPageFragment(final HttpServletRequest request, final String type, final String disposition, final String fragment) {
public static void stashPageFragment(javax.servlet.http.HttpServletRequest request, java.lang.String type, java.lang.String disposition, java.lang.String fragment)
Stashes a page fragment.
Parameters:
request - The current request, at which the page fragment has to be stashed.
type - The stash's (writer) type.
disposition - The disposition, at which the page fragment has to be unstashed.
fragment - The fragment, which has to be stashed.


unstashPageFragments

public static void unstashPageFragments(java.io.Writer out, javax.servlet.http.HttpServletRequest request, java.lang.String disposition)
Unstashes the disposition's page fragments.
throws:
IOException if there was any problem with writing the fragments.
Parameters:
out - The target, to which all fragments have to be written to.
request - The request, at which the fragments have been stashed.
disposition - The disposition, for which all fragments have to be rendered.


 

Groovy Documentation