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.

5
  • you need to show full web.xml. Commented Sep 16, 2016 at 3:59
  • @SabirKhan updated Commented Sep 16, 2016 at 4:05
  • You specify three filters for your default URL, are all those filters getting kicked? Is this an issue only on Websphere Liberty and not on any other container? Commented Sep 16, 2016 at 5:35
  • @SabirKhan yes only on liberty. On tomcat this works fine Commented Sep 16, 2016 at 5:48
  • Generally, Liberty uses CXF and not Jersey (and it's an internal detail). So, if you're opting into Jersey... what Liberty features are enabled? Some of ours can be turned off so they don't fight with Jersey. Commented Sep 17, 2016 at 1:35

1 Answer 1

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> 
Sign up to request clarification or add additional context in comments.

2 Comments

still no difference
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.