aspose file tools*
The moose likes Spring and the fly likes Model Attribute not present in destintation JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Model Attribute not present in destintation JSP" Watch "Model Attribute not present in destintation JSP" New topic
Author

Model Attribute not present in destintation JSP

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1034
I've got a simple Spring MVC application that isn't quite working.

I build up a list of elements in the controller class like this:



In the outPutList.jsp referenced above by the return statement, however, I do NOT get any list items printed out.

Here's that JSP's body section:



-----

All that prints is: "Listing of Items from Controller". The "theList" list doesn't appear to be there when looking at this JSP in the debugger.

I thought Spring would automatically put this "theList" variable into the JSP's session so I could get at it.

Anybody see anything wrong here?

The strange thing is that the Controller class does run and creates the list and Spring does transfer control to the JSP.

It's just that the JSP isn't getting the list to print out.

Thanks in advance for any help or suggestions.

mike
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1034
This issue is resolved.

The only twp minor changes I had to make was the following in the Controller class:

public String createList(final Model model)

.
.
.

model.addAttribute("theList", userList);

---

now it works!

mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Model Attribute not present in destintation JSP
 
Similar Threads
Not able to pass List values to view
SpringMVC 2.5 and DisplayTags
Spring MVC : {beanName.property} not working
How to migrate from struts 1 to struts2?
Spring MVC binding with List of Objects