0

Despite going thru enumerois example I still could not detect the issue am facing ! Any help on the matter would be great assistance.

Error am getting is " No mapping found for HTTP request with URI [/PMDBWebReport/pmdb/] in DispatcherServlet with name 'PMDBReportsDispatcher'

Not sure what is the wrong am making here .. !! My Spec goes like this.

1st Web.xml

    <servlet>
    <servlet-name>PMDBReportsDispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextClass</param-name>
        <param-value>
            org.springframework.web.context.support.AnnotationConfigWebApplicationContext
        </param-value>
    </init-param>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/PMDBReportsDispatcher-servlet.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>PMDBReportsDispatcher</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

My PMDBReportsDispatcher-servlet.xml

     <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/views/viewonly/</value>
    </property>
    <property name="suffix">
        <value>.jsp</value>
    </property>
</bean>

Controller Code is

  @Controller

public class SummaryReportsController {

@RequestMapping(value="/pmdb")
public ModelAndView test(HttpServletResponse response) throws IOException{
        System.out.println("Am inside SummaryReportsController....");
    return new ModelAndView("index");
}

}

![ ]

techsavvy
  • 143
  • 3
  • 16
  • Got the culprit !! :) /WEBINF was the reason !! I changed that and it worked fine .. WEB-INF/views/viewonly/ – techsavvy Oct 31 '13 at 04:53

1 Answers1

0

Change your request mapping and add a * in the context path like this:

<servlet-mapping>
    <servlet-name>PMDBReportsDispatcher</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>
zpontikas
  • 5,445
  • 2
  • 37
  • 41