Displaying Annotation Based View

I am trying to customize the display of annotation based bindings and I am having problems displaying requests directly in jsp.

Do all requests need to go through the controller? Is it possible to just go to jsp without a declaration RequestMapping

for GET

?

I am using InternalResourceViewResolver

. Below is my app-servlet.xml

<context:annotation-config/>

<context:component-scan base-package="com.pioneer.b2broe.web" />

<mvc:annotation-driven />

<mvc:view-controller path="/" view-name="home"/>

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"   p:prefix="/WEB-INF/jsp/"
p:viewClass="org.springframework.web.servlet.view.JstlView" p:suffix=".jsp"  p:order="2"/>

      

+2


a source to share


1 answer


You can use ParameterizableViewController, which redirects the request to the view specified in the "viewName" attribute.




<bean name="/helloworld.htm" class="org.springframework.web.servlet.mvc.ParameterizableViewController">  
    <property name="viewName" value="helloworld"/>  
</bean>

      

+2


a source







All Articles