Annotation Type SessionParameter


  • @Retention(RUNTIME)
    @Target(PARAMETER)
    public @interface SessionParameter
    Maps the parameter to the specified servlet session. If the session parameter is missing, aborts the request with 401 Unauthorized, unless the parameter type is Optional or createIfMissing is set. If the parameter type is Consumer, calling parameter.accept() sets the session attribute instead of returning it
    See Also:
    HttpParameterMapping
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean createIfMissing
      If true, the default constructor is used to create a new object if none exists
      boolean invalidate
      If true and used with Consumer, calling Consumer.accept(T) will invalidate the current session and create a new one.
      String value
      Defaults to the class name of the parameter (removing Consumer or Optional parts of the type)
    • Element Detail

      • value

        String value
        Defaults to the class name of the parameter (removing Consumer or Optional parts of the type)
        Default:
        ""
      • createIfMissing

        boolean createIfMissing
        If true, the default constructor is used to create a new object if none exists
        Default:
        false
      • invalidate

        boolean invalidate
        If true and used with Consumer, calling Consumer.accept(T) will invalidate the current session and create a new one. If true and set with createIfMissing, it will invalidate the session if it created a new one
        Default:
        false