2

I have deployed an application on Websphere Liberty.

When I visit my homepage: localhost:8080/myapp it shows a blank page.

However when I go to localhost:8080/myapp/jsp/status.jsp it displays the page I need.

In my web.xml I have set the welcome file list as:

    <?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
         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_2_5.xsd">
  <listener>
    <listener-class>com.netflix.eureka.EurekaBootStrap</listener-class>
  </listener>

  <filter>
    <filter-name>statusFilter</filter-name>
    <filter-class>com.netflix.eureka.StatusFilter</filter-class>
  </filter>

  <filter>
    <filter-name>requestAuthFilter</filter-name>
    <filter-class>com.netflix.eureka.ServerRequestAuthFilter</filter-class>
  </filter>
  <filter>
    <filter-name>rateLimitingFilter</filter-name>
    <filter-class>com.netflix.eureka.RateLimitingFilter</filter-class>
  </filter>
  <filter>
    <filter-name>gzipEncodingEnforcingFilter</filter-name>
    <filter-class>com.netflix.eureka.GzipEncodingEnforcingFilter</filter-class>
  </filter>

  <filter>
    <filter-name>jersey</filter-name>
    <filter-class>com.sun.jersey.spi.container.servlet.ServletContainer</filter-class>
    <init-param>
      <param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
      <param-value>/(flex|images|js|css|jsp)/.*</param-value>
    </init-param>
    <init-param>
      <param-name>com.sun.jersey.config.property.packages</param-name>
      <param-value>com.sun.jersey;com.netflix</param-value>
    </init-param>

    <!-- GZIP content encoding/decoding -->
    <init-param>
      <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
      <param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
    </init-param>
    <init-param>
      <param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
      <param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>statusFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <filter-mapping>
    <filter-name>requestAuthFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <!-- Uncomment this to enable rate limiter filter.
  <filter-mapping>
    <filter-name>rateLimitingFilter</filter-name>
    <url-pattern>/v2/apps</url-pattern>
    <url-pattern>/v2/apps/*</url-pattern>
  </filter-mapping>
  -->

  <filter-mapping>
    <filter-name>gzipEncodingEnforcingFilter</filter-name>
    <url-pattern>/v2/apps</url-pattern>
    <url-pattern>/v2/apps/*</url-pattern>
  </filter-mapping>

  <filter-mapping>
    <filter-name>jersey</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

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

</web-app>

The file directory structure is:

META-INF
WEB-INF
  --web.xml
jsp
  --status.jsp

I am not able to figure out what is wrong in my setting.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
user1692342
  • 5,007
  • 11
  • 69
  • 128

1 Answers1

1

Which Jeresy version you're using? Better you use jersey version 2.0

There is a known issue on jersey 1.8 checkout here

can you add below under ServletContainer Filter and give a try?

<init-param>
<param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name>
 <param-value>/WEB-INF/jsp/*.jsp</param-value>
</init-param>
Sabir Khan
  • 9,826
  • 7
  • 45
  • 98
ranafeb14
  • 437
  • 1
  • 7
  • 12
  • still no difference – user1692342 Sep 16 '16 at 13:43
  • Next time, as long as you can't reproduce the so far described problem on your own and thus can't explain nor solve it by experience, then please post "Try this" shoot-in-the-darks as comments first, not as answers. The chance is big that they're just wrong and then you would be misguiding and confusing to future readers stumbling on a simliar problem. – BalusC Sep 16 '16 at 21:54