Return to Snippet

Revision: 8336
at September 15, 2008 13:16 by jcblitz


Updated Code
<bean id="viewResolver" class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
	<property name="basename" value="views" />
</bean>

<bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
	<property name="resourceLoaderPath" value="/WEB-INF/velocity/" />
</bean>

<!-- This actually goes in views.properties file below but I added it here for completeness -->

projects.class=org.springframework.web.servlet.view.JstlView
projects.url=/WEB-INF/jsp/projects.jsp

dashboard.class=org.springframework.web.servlet.view.velocity.VelocityView
dashboard.url=dashboard.vm

Revision: 8335
at September 15, 2008 13:13 by jcblitz


Initial Code
<bean id="viewResolver" 	class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
		<property name="basename" value="views" />
	</bean>
	
	<bean id="velocityConfig"		class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
		<property name="resourceLoaderPath" value="/WEB-INF/velocity/" />
	</bean>

<!-- This actually goes in a properties file below but I added it here for completeness -->

projects.class=org.springframework.web.servlet.view.JstlView
projects.url=/WEB-INF/jsp/projects.jsp

dashboard.class=org.springframework.web.servlet.view.velocity.VelocityView
dashboard.url=dashboard.vm

Initial URL

                                

Initial Description
The first part goes in a myspring-servlet.xml context file. The second part is a properties file that is used to map the views with their locations. "projects" displays using a JSP and dashboard displays using a velocity template.

Initial Title
Velocity and JSP views together in Spring configuration

Initial Tags

                                

Initial Language
XML