This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confusion regarding ViewResolvers in Sppring framework

 
andy kumar
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doing a sample project in spring and I have the following issue:-

I have defined the ulr pattern for the dispatcher servlet as /app/* and I have placed all the jps in /WEB-INF/jsp/. I am using a simple form controller. With this settings everything works fine and my application is working. But when I change the dispatcher servlet's url pattern to /* then the controller is found correctly by the dispatcher servlet but the view is not being rendered , I get the error that says no mapping found for the view path(No mapping found for HTTP request with URI [/MVCSpring/WEB-INF/jsp/usernameAndEmail.jsp]). I am not sure what is happening here, I have spent 2 days trying to figure the issue but no luck, could someone point out where I am going wrong.

Thanks a lot for the help.

WEB.XML

<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>

</servlet>

<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>

spring-servlet.xml

<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp"/>
</bean>


Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic