Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-14206

HttpSessionRequiredException should have a getter for 'expected session attribute'

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.2.5, 4.3 RC1
    • Fix Version/s: 4.3 RC2
    • Component/s: Core
    • Labels:

      Description

      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
      }
      

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            Sola Sola
            Last updater:
            Spring Issuemaster
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 40 weeks, 6 days ago