-
Dec 17th, 2008, 01:13 PM
#1
ModelAndView.addObject("","") and JSTL
Hi am running in to a problem where I have dynamically created menu list created based on server data set on the controller through:
ModelAndView.addObject("mydataList",data)
on my JSP I abstract the data using JSTL as such:
<c:forEach var="menuItem" items="${mydataList}">
...print the menus....
</c:forEach>
...
make Ajax call every 1 minute to get menu list again and recreate the menus.
...
The problem is that on the controller side, where I am adding the object, the correct values are added to the Model but on the JSP side, it keeps printing the old values from the first time (when page loaded). I am calling ModelAndView.clear() to make sure there is nothing before adding object to Model, but I don't know why the JSP keeps pulling old values.
Any suggestions are greatly appreciated.
--
-
Dec 18th, 2008, 03:15 AM
#2
This might be a caching problem. I faced something similar too but only on IE because IE kept caching my pages while FF didn't. Try testing your page on FF and see if it works. Adding cache-control to your page should work either way.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules