Hi,
I am new to spring.this question may be too silly but i realyy need help.
I am having issues when I am using @RequestMapping in class level.
Please have a look and let me know the cause of this problem:
CONTROLLER CLASS:
package com.gontuseries.hellocontroller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("/greet/*")
public class HelloController {
@RequestMapping("/welcome")
protected ModelAndView Hello() {
ModelAndView modelandview = new ModelAndView("HelloPage");
modelandview.addObject("welcomeMessage", "Jyoti");
return modelandview;
}
}
FRONT CONTROLLER:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:component-scan base-package="com.gontuseries.hellocontroller" />
<mvc:annotation-driven/>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name="prefix">
<value>\WEB-INF/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
</beans>
when it is returning the path, i dont know why "/greet/" is getting appended to the classpath..beacuse of which the correct location of
jsp page is misleading and i get a 404 error.
ERROR MESSAGE:
type Status report
message /NewSpPr/greet/WEB-INF/HelloPage.jsp
description The requested resource (/NewSpPr/greet/WEB-INF/HelloPage.jsp) is not available.
Please reply to my issue.