0

What's the difference between "ModelAndView.addObject" and "Session.setAttribute" in spring MVC?

Seems both them can share the Object and used in JSP .

1 Answer 1

5

There are a lot of differences, but you are asking from the perspective of the JSP page.

In that respect, ModelAndView.addObject will make the variable available to the request scope of the JSP, and Session.setAttribute will make the variable available to the session scope of the JSP.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.