0

I got a problem with load .css file, I put 'resources' in wrong folder probably and I dont know where I have to put it. How it should looks like? Here is a screen: enter image description here

and I am loading css file like this:

<link rel="stylesheet" type="text/css" href="resources/css/flower.css" />
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
dante
  • 393
  • 1
  • 15
  • 31
  • @cricket_007 I put resources folder in WEB-INF - doesn't work still, after that I put .xhtml file in WEB-INF too, but it still doesn't work – dante Jun 05 '16 at 13:06
  • @cricket_007 that's completely wrong. WEB-INF is precisely the only directory that is not served by the container. So any requests coming from the browser to something under WEB-INF will fail. – JB Nizet Jun 05 '16 at 13:07
  • what is the URL, in the location bar of your browser? Why don't you use an absolute URL in the view? WHat do you use for the view? JSP, thymeleaf? Something else? – JB Nizet Jun 05 '16 at 13:09
  • @JBNizet "http://localhost:8080/SimpleFlowerProject/home.html", now I noticed that in console this error appears: 'WARNING: No mapping found for HTTP request with URI [/SimpleFlowerProject/resources/css/flower.css]' its weird, because content of .xhtml is displaying. Absolute URL? Do you mean the whole path which would be leading to css? I'm using JSF with Spring and Hibernate – dante Jun 05 '16 at 13:15
  • 1
    Read http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc-config-static-resources and http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc-default-servlet-handler – JB Nizet Jun 05 '16 at 13:18
  • Are you using Java EE or Spring? Different rules apply. Having XHTML files as views and putting resources in /resources folder is typical for JSF (which is part of Java EE, not Spring). When looking for answers and asking questions, please use the right keywords. Here's at least a related reading: http://stackoverflow.com/questions/18744910/using-jsf-as-view-technology-of-spring-mvc – BalusC Jun 05 '16 at 13:53

0 Answers0