How TO Resolve a Request URL to a JSP in Spring


/ Published in: Java
Save to your folder(s)

To tell Spring to resolve a request URL to a JSP page, add a "view resolver" in the context configuration for the DispatchServlet.


Copy this code and paste it in your HTML
  1. <bean id="viewResolver"
  2. class="org.springframework.web.servlet.view.UrlBasedViewResolver">
  3. <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
  4. <property name="prefix" value="/WEB-INF/jsp/"/>
  5. <property name="suffix" value=".jsp"/>
  6. </bean>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.