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