Spring Web: Correct way to have a single default ViewResolver

Posted by wuntee on Stack Overflow See other posts from Stack Overflow or by wuntee
Published on 2010-05-11T16:01:36Z Indexed on 2010/05/11 16:04 UTC
Read the original article Hit count: 159

Filed under:
|

What is the best way to have every request be sent to a single ViewResolver - specifically in this case a JsonView?

Was thinking this:

<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    <property name="viewClass" value="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
    <property name="prefix" value="*" />
</bean>

but, is there something better/easier?

© Stack Overflow or respective owner

Related posts about spring-mvc

Related posts about view