// archives

spring mvc

This tag is associated with 3 posts

Why Did I Want a JSON View Resolver?

In my previous post, I documented a scenario that I encountered while setting up a JSON view resolver in a Spring MVC project.  Let me take a step back and explain my motivations for why I wanted a JSON view resolver. In any Spring MVC application, Controller classes are responsible for processing some data, then [...]

Spring MVC Custom Property Editors

From my experience, one of the initially frustrating things in Spring MVC was figuring out how to use a Property Editor correctly. The idea is simple. You want to be able to convert back and forth between Java objects and their String representations. For example, let’s say you are making an internal website for a [...]

Chaining Spring View Resolvers

Take this example of chaining view resolvers: <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/> </bean> <bean id="jsonViewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">   <property name="location" value="/WEB-INF/views.xml"/>   <property name="order" value="1"/> </bean> And this views.xml: <beans><bean name="jsonView" class="org.springframework.web.servlet.view.json.JsonView"/></beans> This should evaluate each view through the XmlViewResolver, then default back to the UrlBasedViewResolver if the XmlViewResolver does not find a view. Now, [...]