404 NoTargetForURIException accessing static resources in WebContent folder under Websphere 7

StackOverflow https://stackoverflow.com/questions/19882354

  •  30-07-2022
  •  | 
  •  

Вопрос

In an Eclipse web project targeting WebSphere Application Server 7, I have CSS files in a css subfolder under WebContent. When I try to access them from a browser I get a 404 error saying:

Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /css
Это было полезно?

Решение

The solution was to enable file serving in ibm-web-ext.xml.

  1. Double-click on web.xml to open up the Web Application Deployment Description Editor.
  2. Select the "Open WebSphere Extensions Descriptor" link.
  3. Select the "Enable File Serving" checkbox and save your changes.

This adds the following line to ibm-web-ext.xml:

<enable-file-serving value="true"/>

Acknowledgement to CodeRanch for the solution.

Другие советы

Another way to get this error is if your path name after the host is wrong. For example if you are deploying an EAR, and try to hit the name of the EAR. You have to make sure make sure the path matches the web application name exactly.

enter image description here

Make sure the context root is correct.

One can do this in the WebSphere Application Server administration console. Check IBM's Resolving the problem.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top