0

I've got a simple spring web app project developed using eclipse IDE. When I run the project using a jetty server, the server starts. Then I try to go to the context using the details, it says the following error of 404.

enter image description here

This is my web.xml file where I defined the starting screen.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>TouchPOS</display-name>
  <servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>*.html</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>layout.html</welcome-file>
  </welcome-file-list>
</web-app>

And this is the project resources.

enter image description here

What am I doing wrong here? There is no exceptions while starting the server. Please help me!

I viewed the console and the following error was given! How can I resolve this!

    WARNING: No mapping found for HTTP request with URI [/TouchPOSApplication/layout.html] in DispatcherServlet with name 'dispatcher'
Apr 19, 2013 10:53:48 AM org.springframework.web.servlet.PageNotFound noHandlerFound

mvc-config file

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    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-3.0.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">

    <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
    <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
</beans>    
Imesh Chandrasiri
  • 5,558
  • 15
  • 60
  • 103

1 Answers1

0

Are you sure that your application runs in the webapp context path you expect it to run? What's the name of your war file and did you provide a jetty context.xml file for that webapp where you configure the context path?

If not, then try using the name of the war file as context path:

e.g.:

if the name of the war is "webapps/touchpos.war" try "http://localhost:8080/touchpos/".

Thomas Becker
  • 934
  • 8
  • 16