Class FormUtil

java.lang.Object
org.flasby.login2.utils.FormUtil

@Singleton @Model public final class FormUtil extends Object
  • Constructor Details

    • FormUtil

      public FormUtil()
  • Method Details

    • processLoginPostData

      public Map<String,String> processLoginPostData(@NotNull io.javalin.http.Context ctx, String... attributes)
      manages the collection of Attributes expected on a Form submitted to the WebApp.
      It gathers all the Attributes valueds present on the Form and if any are missing (as specified by the attributes list passed in) then it initialize the entry in the map with an empty String.
      Parameters:
      ctx - the Javalin Context
      attributes - a list of all attributes required to be in the returned Map.
      Returns:
      a map containing attribute values for all the attributes passed in.
    • validateParam

      public boolean validateParam(String paramName, Map<String,List<String>> params)
    • getValueOrDefault

      public String getValueOrDefault(String paramName, String defaultValue, Map<String,List<String>> params)
    • build

      public <T> T build(io.javalin.http.Context context, Class<T> clazz)