Skip to content

HttpSessionRequiredException should have a getter for 'expected session attribute' [SPR-14206] #18780

@spring-projects-issues

Description

@spring-projects-issues

Sola opened SPR-14206 and commented

HttpSessionRequiredException should have a getter for 'missing session attribute',It can bring more convince to exception handling.

ideal code snippet:

@ExceptionHandler(HttpSessionRequiredException.class)
ResponseEntity<Error> unauthorizedException(HttpSessionRequiredException e) {
	if(e.getAttributeName().equals("username")){
		//do something else,
	}
	return //something
}

Affects: 4.2.5, 4.3 RC1

Reference URL: https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/HttpSessionRequiredException.java

Referenced from: commits e5d52a9

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions