Servlets are not allowed to access files in the META-INF or WEB-INF directory

When migrating to WebSphere Application Server traditional or Liberty, files located in the META-INF and WEB-INF directories cannot be accessed from servlets. This rule flags HTML, JSP and image files located in those directories. To avoid file not found issues, move content that needs to be accessed from servlets to the WebContent directory. If that is not possible, you can allow the servlets access to files contained in the WEB-INF directory in Liberty by adding the following line in the server.xml file:

<webContainer exposeWebInfOnDispatch="true"/>

When you set exposeWebInfOnDispatch="true", dispatched requests will have access to all files located in the WEB-INF and META-INF directories.

For more information, see the Web Container documentation.

For information on setting web container custom properties on WebSphere Application Server traditional, see the Web container custom properties documentation.