Package com.atlassian.confluence.xwork
Class FlashScope
- java.lang.Object
-
- com.atlassian.confluence.xwork.FlashScope
-
public class FlashScope extends Object
Flash Scope allows one request to pass data to the next request if it's a redirect.FlashScope only becomes available if the redirect action result is specified as "redirectwithflash" (check struts.xml) In a REST request, need to call
persist()
andgetFlashScopeUrl(String, String)
to persist and build the URL that supports FlashScope
-
-
Constructor Summary
Constructors Constructor Description FlashScope()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
get(String key)
Retrieves FlashScope items stored in the previous requeststatic String
getFlashScopeUrl(String url, String flashId)
Decorate an URL with FlashScope information.static boolean
has(String key)
static String
persist()
Persist FlashScope values recorded so far in the current request usingput(String, Object)
static void
put(String key, Object value)
Adds things to the FlashScope.
-
-
-
Method Detail
-
put
public static void put(String key, Object value)
Adds things to the FlashScope. They will be available to the request after the current one.
-
has
public static boolean has(String key)
- Returns:
- true if FlashScope item was stored in the previous request
-
getFlashScopeUrl
public static String getFlashScopeUrl(String url, String flashId)
Decorate an URL with FlashScope information. The next request with the decorated URL will have access to FlashScope values. Mainly for use inside REST requests. Inside an XWork request, seeRedirectWithFlashResult
- Parameters:
url
- a normal url without FlashScope information yetflashId
- FlashScope information- Returns:
- decorated url which carries the FlashScope information
-
persist
public static String persist()
Persist FlashScope values recorded so far in the current request usingput(String, Object)
- Returns:
- a String carrying FlashScope information, which can be used in
getFlashScopeUrl(String, String)
-
-