When I am trying to execute @RequestMapping("/showForm")
I am facing an error.
I think my code seems fine, I am simply returning new String with the name of my JSP file - "mainmenu.jsp". I have this folder the folder JSP in the right place. The error:
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Where can be the problem?
<mvc:annotation-driven />
<context:component-scan
base-package="com.crunchify.controller" />
<mvc:default-servlet-handler />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<servlet>
<servlet-name>crunchify</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>crunchify</servlet-name>
<url-pattern>/welcome.jsp</url-pattern>
<url-pattern>/mainmenu.jsp</url-pattern>
<url-pattern>/mainmenu.html</url-pattern>
<url-pattern>/processForm.jsp</url-pattern>
<url-pattern>/processForm.html</url-pattern>
<url-pattern>/index.jsp</url-pattern>
<url-pattern>/main-menu.jsp</url-pattern>
<url-pattern>/welcome.html</url-pattern>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
The actual request:
@RequestMapping("/showForm")
public String helloWorld() {
return "mainmenu";
}