Package com.helger.web.scope.util
Class SessionBackedRequestFieldData
- java.lang.Object
-
- com.helger.web.scope.util.AbstractRequestFieldData
-
- com.helger.web.scope.util.RequestFieldData
-
- com.helger.web.scope.util.SessionBackedRequestFieldData
-
public class SessionBackedRequestFieldData extends RequestFieldData
A specialized request field that uses a value stored in the session as the default, in case no parameter is passed. If no value is in the session either the hard coded default value is used.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description SessionBackedRequestFieldData(String sFieldName)SessionBackedRequestFieldData(String sFieldName, String sDefaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDefaultValue()StringgetSessionFieldName()-
Methods inherited from class com.helger.web.scope.util.RequestFieldData
equals, getRequestValue, getRequestValueWithoutDefault, hashCode, hasRequestValue, toString
-
Methods inherited from class com.helger.web.scope.util.AbstractRequestFieldData
getFieldName, getParams
-
-
-
-
Method Detail
-
getSessionFieldName
@Nonnull @Nonempty public String getSessionFieldName()
- Returns:
- The name of the session scope variable that contains the stored value.
-
getDefaultValue
public String getDefaultValue()
- Overrides:
getDefaultValuein classRequestFieldData- Returns:
- The default value to be used if no request parameter is present. Is
never
nullbut an empty string if no default value is available.
-
-