Skip to content

When a controller method redirect to any url, the framework automatically appends all the model attributes in url query string even if those attributes are stored in session. [SPR-8636] #13278

@spring-projects-issues

Description

@spring-projects-issues

Angel opened SPR-8636 and commented

Example

@Controller
@SessionAttributes({"context"})
public class AuthenticationAction {
    @RequestMapping("/login")
    public String login(@RequestParam(required=false, "errorCode") String errorCode,
                        @ModelAttribute("context") String context) {
        return "redirect:/action/login/" + context;
    }
}

This example will redirect to the url: .../action/login/{context}?context=value

The parameter "context" and its value should not appear in the url query string by default in this case because they are already in session.


Affects: 3.1 M2

Issue Links:

1 votes, 2 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions