Commits

James Sumners committed f767866

Added a JSP view resolver to the applicationContext.xml

  • Participants
  • Parent commits 5af2441

Comments (0)

Files changed (1)

src/main/webapp/WEB-INF/springmvc-skel-servlet.xml

   <context:component-scan
     base-package="com.example.MyWebApplication"
     />
+
+  <!--
+    Define a JSP resolver. When a request is made that resolves to a view
+    {viewname} then this resolver will look for {viewname}.jsp in the defined
+    location ("/WEB-INF/jsp/").
+  -->
+  <bean
+    id="jspViewResolver"
+    class="org.springframework.web.servlet.view.UrlBasedViewResolver">
+    <property>
+      <name>viewClass</name>
+      <value>org.springframework.web.servlet.view.JstlView</value>
+    </property>
+
+    <property>
+      <name>prefix</name>
+      <value>/WEB-INF/jsp/</value>
+    </property>
+
+    <property>
+      <name>suffix</name>
+      <value>.jsp</value>
+    </property>
+  </bean>
 </beans>