views:

40

answers:

1

I am trying to get my head around annotation based mappings and I am having some trouble mapping requests directly to jsp.

Do all request have to go through a controller? Is it possible to make it just go to a jsp without declaring a RequestMapping for GET?

I am using a 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"/>
+1  A: 

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


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

Hussain