ModelAndView is an object that holds both the model and view. The handler returns the ModelAndView object and DispatcherServlet resolves the view using View Resolvers and View. Use this tag for Spring MVC Framework.
Questions tagged [modelandview]
117 questions
0
votes
1 answer
Spring MVC 3 ModelAndView: controller method to return several views
my requirement is to return view according to the selected value (select form)
view.jsp:

RaisMEd
- 95
- 1
- 2
- 9
0
votes
1 answer
ModelAndView Model objects not emptied on re-creation
My question is related to
Spring mvc interceptor addObject
At some point my application needs to know what the previousUrl is that has been visited, so in some occasions the previousUrl is stored in the ModelAndView and 'previous' can be called.
In…

user1829860
- 111
- 1
- 10
0
votes
0 answers
Spring ModelAndView not rendering the returned view
I am having a problem with springs ModelAndView. I am making a post call from a form, and all i want is to render a new page after that post. This should not be a difficult task but i cannot seem to do it! So here is my code:
//controller logic
…

Loshmeey
- 341
- 1
- 5
- 18
0
votes
1 answer
Spring 3 -- 404 error using a ModelAndView
I am getting this 404 error message
The requested resource (/ghs1986/WEB-INF/pages/poll1.jsp) is not available.
from this controller method.
@RequestMapping(value = "/poll1", method = RequestMethod.POST)
public ModelAndView…
user636859
0
votes
1 answer
Ajax to Spring MVC Controller and back
Here's the desired flow that I am looking for :
Large data (table) is passed to Spring Controller through a javascript function.
Controller processes the data.
Controller returns a new ModelAndView
Render this new ModelAndView on the screen.
I…

Angad
- 3,389
- 3
- 30
- 40
0
votes
1 answer
Spring preprocess request in another controller method
In one of my controllers I have:
@RequestMapping(value = "search", method = RequestMethod.GET)
public ModelAndView searchUsers(HttpSession session, HttpServletRequest request) {
UiUserSearchCriteria userSearchCriteria = (UiUserSearchCriteria)…

madhead
- 31,729
- 16
- 153
- 201
0
votes
1 answer
Retrieving a model from ModelAndView in jsp
I am currently trying to return a model from onSubmit() in my controller. I then am trying to retrieve this in my jsp.
for example
Map model = new HashMap();
model.put("errors", "example error");
return new ModelAndView(new…

smauel
- 1,757
- 6
- 20
- 25
0
votes
1 answer
MVC Spring Model - dynamically accessing attribute list index
I have a question regarding how to access an index from a model attribute list dynamically.
In my code, I have some javascript which is reading a value from a model. The model has an attribute which is potentially a…

David Levins
- 35
- 6
0
votes
2 answers
Spring: Best way to select a customized view at runtime
I am looking to borrow someone's brains (& experience) to figure out an optimum way to implement the below.
I am currently working on an application which will be used by many of our clients and will require UI customizations according to each…

Sumit
- 540
- 9
- 20
-1
votes
1 answer
If and else block is executed during spring method annotated as Transactional
When I go to /confirmation-account link, in tomcat console I can see that if and else block is also executed. I can see:
print from ColorConsoleHelper.getGreenLog("loginView") and from ColorConsoleHelper.getGreenLog("confirmationAccountView")
This…

Marcin Warycha
- 65
- 1
- 8
-1
votes
2 answers
"This method must return a result of type ModelAndView." - when returning a result of type ModelAndView
In the LoginView method it shows an error that there must be a return of type ModelAndView. But I am returning a result of type ModelAndView.
@RequestMapping("/login")
public loginView( HttpServletRequest request, HttpServletResponse res)
{
…

Danura Selaka Senan
- 75
- 1
- 2
- 10
-1
votes
1 answer
Collection is not in scope of jsp file (Spring MVC, ModelAndView)
Usually i can find solution provided by StackOverflow community in older questions. This time my brain stopped working, i guess...
All I'm trying to do is show a list of customers which I'm taking out of MySQL database. Everything is going fine, but…

Adrian M
- 3
- 3