The Jsp file does not start in web.xml

advertisements

I am trying to run jsp file as a welcome file in my applications.

Here is my web.xml file :

<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <servlet>
        <servlet-name>RESTServiceFrontEnd</servlet-name>
        <servlet-class>
                com.sun.jersey.spi.container.servlet.ServletContainer
            </servlet-class>
        <init-param>
          <param-name>javax.ws.rs.Application</param-name>
          <param-value>
                    enceladus.server.rest.FrontEnd
                </param-value>
        </init-param>
        <init-param>
          <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
          <param-value>
                    com.sun.jersey.api.container.filter.LoggingFilter
                </param-value>
        </init-param>
        <init-param>
          <param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
          <param-value>
                    com.sun.jersey.api.container.filter.LoggingFilter
                </param-value>
        </init-param>
        <init-param>
          <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
          <param-value>true</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
     </servlet>

      <servlet-mapping>
        <servlet-name>RESTServiceFrontEnd</servlet-name>
        <url-pattern>/*</url-pattern>
      </servlet-mapping>

    </web-app>

and my jsp file:

        <%@page import="enceladus.server.objects.Management"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
    <%
        Management m = Management.getInstance();
    System.out.println("asdasfdfsgsdgdafgdfg");
    %>
</body>
</html>

When I removed everything except of welcome-file it works perfect. I also have a message from my serwer:

19-lug-2012 11.08.22 com.sun.jersey.api.container.filter.LoggingFilter$Adapter finish INFO: 1 * Server out-bound response 1 < 404 1 <

Thanks in advance


Please define welcome-file-list below servlet mappingas per web-app_2_3.dtd

 <servlet-mapping>
   <servlet-name>RESTServiceFrontEnd</servlet-name>
  <url-pattern>/*  </url-pattern>
</servlet-mapping>
<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>