Top Description Fields Constructors Methods
org.springframework.web

public Class HttpSessionRequiredException

extends ServletException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
jakarta.servlet.ServletException, org.springframework.lang.Nullable

Exception thrown when an HTTP request handler requires a pre-existing session.
Author
Juergen Hoeller
Since
2.0

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
HttpSessionRequiredException(String
the detail message
msg
)

Create a new HttpSessionRequiredException.

public
HttpSessionRequiredException(String
the detail message
msg
,
String
the name of the expected session attribute
expectedAttribute
)

Create a new HttpSessionRequiredException.

Method Summary

Modifier and TypeMethod and Description
public String
getExpectedAttribute()

Return the name of the expected session attribute, if any.

Inherited from jakarta.servlet.ServletException:
getRootCause

Field Detail

expectedAttributeback to summary
private final String expectedAttribute
Annotations
@Nullable

Constructor Detail

HttpSessionRequiredExceptionback to summary
public HttpSessionRequiredException(String msg)

Create a new HttpSessionRequiredException.

Parameters
msg:String

the detail message

HttpSessionRequiredExceptionback to summary
public HttpSessionRequiredException(String msg, String expectedAttribute)

Create a new HttpSessionRequiredException.

Parameters
msg:String

the detail message

expectedAttribute:String

the name of the expected session attribute

Since
4.3

Method Detail

getExpectedAttributeback to summary
public String getExpectedAttribute()

Return the name of the expected session attribute, if any.

Annotations
@Nullable
Since
4.3