Spring Framework

Spring Projects

Spring Project 1

InternalResourceViewResolver in Spring MVC
Previous Home Next

This view resolver subclass of UrlBasedViewResolver that supports InternalResourceView and subclasses such as JstlView and TilesView. This view resolver provide the facility to add the prefix of the view name and add the suffix of the view name.

Syntax:

public class InternalResourceViewResolver
extends UrlBasedViewResolver

This view resolver provide the following method:

requiredViewClass:

protected Class requiredViewClass()

setAlwaysInclude:

public void setAlwaysInclude
(boolean alwaysInclude)

buildView:

protected AbstractUrlBasedView buildView
(String viewName)throws Exception

 

Example

<bean id="viewResolver"
class="org.springframework.web.servlet.
view.InternalResourceViewResolver" >
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>

Example of InternalResourceViewResolver in Spring MVC

Previous Home Next