Announcement Announcement Module
Collapse
No announcement yet.
No mapping found for HTTP request with URI in dispatcherservlet Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No mapping found for HTTP request with URI in dispatcherservlet

    Hi guys,

    Am a spring newbie, am trying to get a hello world example going but am getting the following error in my tomcat console,
    No mapping found for HTTP request with URI in dispatcherservlet

    This is my web.xml
    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>

    <servlet>
    <servlet-name>spring</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>spring</servlet-name>
    <url-pattern>/</url-pattern>
    </servlet-mapping>

    This is my spring-servlet.xml
    <bean id="jspViewResolver"
    class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
    <property name="viewClass"
    value="org.springframework.web.servlet.view.JstlVi ew" />
    <property name="prefix" value="/WEB-INF/jsp/" />
    <property name="suffix" value=".jsp" />
    </bean>

    Now what I want to achieve is when I type in http://localhost:8080/AppName the app go to index.html, which is located in /WEB-INF/index.html

    But when I go http://localhost:8080/AppName/Home.html, the app should go to home.jsp, which is located in /WEB-INF/jsp/home.jsp

    Can somebody here please clear my doubt.

    Thanks.

  • #2
    Do both URLs result in a 404?
    First, welcome file list entries are relative to the web application root so the associated file can't be located in WEB-INF (you could use an empty html file with a redirect). The 2nd URL should resolve to a JSP /WEB-INF/jsp/Home.jsp (I think Spring is case-sensitive by default but I'm not sure), doesn't it?
    (with AppName you mean the context root of the web app right?)

    Robin.

    Comment

    Working...
    X