/ Published in: XML
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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<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