|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjetbrains.buildServer.controllers.FormUtil
public class FormUtil
Utility methods for working with Java beans representing web forms on the server side.
| Nested Class Summary | |
|---|---|
static interface |
FormUtil.FormCreator<T>
Form bean factory |
| Constructor Summary | |
|---|---|
FormUtil()
|
|
| Method Summary | ||
|---|---|---|
static org.springframework.validation.BindingResult |
bindFromRequest(javax.servlet.http.HttpServletRequest request,
java.lang.Object form)
Fills properties of the specified form bean from the request. |
|
static
|
getFromSession(javax.servlet.http.HttpSession sess,
java.lang.Class<T> clazz)
Obtains the form bean of the specified class from the session |
|
static
|
getFromSession(javax.servlet.http.HttpSession sess,
java.lang.Class<T> clazz,
java.lang.String customKey)
Obtains the form bean of the specified class with specified custom key from the session |
|
static
|
getOrCreateForm(javax.servlet.http.HttpServletRequest request,
java.lang.Class<T> clazz,
FormUtil.FormCreator<T> formCreator)
Obtains a form bean from the session if it exists or creates a new form bean and stores it in the session. |
|
static
|
getOrCreateForm(javax.servlet.http.HttpServletRequest request,
java.lang.Class<T> clazz,
java.lang.String customKey,
FormUtil.FormCreator<T> formCreator)
Obtains a form bean from the session if it exists or creates a new form bean and stores it in the session. |
|
static boolean |
isInitPageRequest(javax.servlet.http.HttpServletRequest request)
Returns true if the specified request contains 'init' parameter |
|
static void |
removeAllFromSession(javax.servlet.http.HttpSession sess,
java.lang.Class... classes)
Removes all form beans from the session of the specified classes |
|
static void |
removeFromSession(javax.servlet.http.HttpSession sess,
java.lang.Class clazz)
Removes form bean with specified class from the session |
|
static
|
removeFromSession(javax.servlet.http.HttpSession sess,
java.lang.Class<T> clazz,
Filter<T> formBeansFilter)
Removes form beans of the specified class and matched by the filter from the session |
|
static void |
removeFromSession(javax.servlet.http.HttpSession sess,
java.lang.Class clazz,
java.lang.String customKey)
Removes form bean with specified class and custom key from the session |
|
static void |
removeFromSession(javax.servlet.http.HttpSession sess,
Filter formBeansFilter)
Removes form beans matched by the filter from the session |
|
static void |
storeInSession(javax.servlet.http.HttpSession sess,
java.lang.Object form)
Stores the specified form bean in the session. |
|
static void |
storeInSession(javax.servlet.http.HttpSession sess,
java.lang.Object form,
java.lang.String customKey)
Stores the specified form bean in the session. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FormUtil()
| Method Detail |
|---|
public static org.springframework.validation.BindingResult bindFromRequest(@NotNull
javax.servlet.http.HttpServletRequest request,
@NotNull
java.lang.Object form)
request - requestform - form bean
public static void storeInSession(@NotNull
javax.servlet.http.HttpSession sess,
@NotNull
java.lang.Object form)
sess - HTTP sessionform - form bean
public static void storeInSession(javax.servlet.http.HttpSession sess,
java.lang.Object form,
java.lang.String customKey)
sess - HTTP sessionform - form beancustomKey - additional key
@Nullable
public static <T> T getFromSession(@NotNull
javax.servlet.http.HttpSession sess,
@NotNull
java.lang.Class<T> clazz)
sess - HTTP sessionclazz - class of the form bean
@Nullable
public static <T> T getFromSession(@NotNull
javax.servlet.http.HttpSession sess,
@NotNull
java.lang.Class<T> clazz,
java.lang.String customKey)
sess - HTTP sessionclazz - class of the form beancustomKey - additional key
public static void removeFromSession(@NotNull
javax.servlet.http.HttpSession sess,
@NotNull
java.lang.Class clazz)
sess - HTTP sessionclazz - class of the form bean
public static <T> void removeFromSession(@NotNull
javax.servlet.http.HttpSession sess,
@NotNull
java.lang.Class<T> clazz,
@NotNull
Filter<T> formBeansFilter)
sess - HTTP sessionclazz - class of the form beanformBeansFilter - filter which should return true if form must be removed and false otherwise
public static void removeFromSession(@NotNull
javax.servlet.http.HttpSession sess,
@NotNull
Filter formBeansFilter)
sess - HTTP sessionformBeansFilter - filter which should return true if form must be removed and false otherwise
public static void removeAllFromSession(@NotNull
javax.servlet.http.HttpSession sess,
java.lang.Class... classes)
sess - HTTP sessionclasses - form beans classes
public static void removeFromSession(@NotNull
javax.servlet.http.HttpSession sess,
@NotNull
java.lang.Class clazz,
java.lang.String customKey)
sess - HTTP sessionclazz - class of the form beancustomKey - additional key
@Nullable
public static <T> T getOrCreateForm(javax.servlet.http.HttpServletRequest request,
java.lang.Class<T> clazz,
FormUtil.FormCreator<T> formCreator)
request - HTTP requestclazz - class of the form beanformCreator - form bean factory
formCreator returned null
@Nullable
public static <T> T getOrCreateForm(javax.servlet.http.HttpServletRequest request,
java.lang.Class<T> clazz,
java.lang.String customKey,
FormUtil.FormCreator<T> formCreator)
request - HTTP requestclazz - class of the form beancustomKey - additional keyformCreator - form bean factory
formCreator returned nullpublic static boolean isInitPageRequest(javax.servlet.http.HttpServletRequest request)
request - request
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||