jetbrains.buildServer.web.util
Class CameFromSupport

java.lang.Object
  extended by jetbrains.buildServer.web.util.CameFromSupport

public class CameFromSupport
extends java.lang.Object

This class is used to provide basic support of 'came from' functionality. Main purpose - support 'Cancel' link for administration pages


Field Summary
static java.lang.String CAME_FROM_URL
           
 
Constructor Summary
CameFromSupport()
           
 
Method Summary
 java.lang.String getCameFromTitle()
          Return came from title, if was set previously using setTitleFromRequest call
 java.lang.String getCameFromUrl()
          Return came from URL setting, if was set previously using setUrlFromRequest call
 void setTitleFromRequest(javax.servlet.http.HttpServletRequest request, java.lang.String defaultTitle)
          Set value for came from title by trying to find "cameFromTitle" request parameter
static void setupCameFromUrl(java.util.Map model, javax.servlet.http.HttpServletRequest request)
          Setup 'cameFromUrl' variable in model basing on current request
 void setUrlFromRequest(javax.servlet.http.HttpServletRequest request, java.lang.String defaultUrl)
          Set value for came from url by trying to find "cameFromUrl" request parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAME_FROM_URL

@NonNls
public static final java.lang.String CAME_FROM_URL
See Also:
Constant Field Values
Constructor Detail

CameFromSupport

public CameFromSupport()
Method Detail

setupCameFromUrl

public static void setupCameFromUrl(java.util.Map model,
                                    javax.servlet.http.HttpServletRequest request)
Setup 'cameFromUrl' variable in model basing on current request

Parameters:
model - model to update
request - request

getCameFromUrl

@Nullable
public java.lang.String getCameFromUrl()
Return came from URL setting, if was set previously using setUrlFromRequest call

Returns:
see above

getCameFromTitle

@Nullable
public java.lang.String getCameFromTitle()
Return came from title, if was set previously using setTitleFromRequest call

Returns:
see above

setUrlFromRequest

public void setUrlFromRequest(javax.servlet.http.HttpServletRequest request,
                              java.lang.String defaultUrl)
Set value for came from url by trying to find "cameFromUrl" request parameter

Parameters:
request - http request
defaultUrl - default value for URL, if wasn't found in the request

setTitleFromRequest

public void setTitleFromRequest(javax.servlet.http.HttpServletRequest request,
                                java.lang.String defaultTitle)
Set value for came from title by trying to find "cameFromTitle" request parameter

Parameters:
request - http request
defaultTitle - default value for title, if wasn't found in the request