0

In minimal application I can use CSS

VERSIONS

IDEA 2018.2
jsf-app and jsf-impl version 2.2.5
javax.servlet-api 3.1.0
javax.servlet.jsp-api 2.3.3

Hear is project structure and index.htnl

enter image description here

The page result:

enter image description here

UPDATE:

Image also doesn't works. It seams problem in resources folder

enter image description here

and result

enter image description here

Added explicitly added to POM.xml following build part, but also NOT helped. Question WHY?

<build>
    <finalName>Spring Examples</finalName>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
    </resources>
</build>
Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Ashot Karakhanyan
  • 2,804
  • 3
  • 23
  • 28
  • Before this post I search the problem solution but does not found any necessary answers (all I found) vich solved problem. I think this is issue related IntelliJ IDEA and JSF implementation. I tried many examples but get the same problem. Please give the solution which found, may be that one I tried. hank you very much. – Ashot Karakhanyan Sep 16 '18 at 09:39
  • Look at the top of your question. – BalusC Sep 17 '18 at 01:00
  • Sorry, but I understand what you mean. If you about "In minimal application I can use CSS " so yes, this is minimal application what works in IntelliJ. In your link it don't related in Intellij specific problem. – Ashot Karakhanyan Sep 17 '18 at 07:35
  • @Kukeltje OK, resources folder does not work, so WHY IDEA auto generate a project directory which is in fact does not work. – Ashot Karakhanyan Sep 17 '18 at 10:26
  • Scroll to top. There's a yellow box which says: "**This question already has an answer here**: _How to reference CSS / JS / image resource in Facelets template?_". The last line is a link. Click on it. You'll be redirected to the duplicate question which contains the answer you're looking for. – BalusC Sep 17 '18 at 10:38
  • @BalusC I of course clicked and entered and read but IDEA specific information doesn't found.Sorry. – Ashot Karakhanyan Sep 17 '18 at 10:46
  • @AshotKarakhanyan: Check the **location where to put these resources** in the duplicate above. Read carefully, not quickly... It is all 100% in there – Kukeltje Sep 17 '18 at 11:33
  • @Kukeltje I tried all possible places, but it is don't wont to help me :). I think that resources folder does not work in my project. (but it recourse icon exists). – Ashot Karakhanyan Sep 17 '18 at 11:46
  • What 'all possible places'? I don't see any other place then `src/main/resources' for the css and the image in your project. And according to the duplicate that is not the right place... All the info is in the **Folder Structure** in the duplicate. – Kukeltje Sep 17 '18 at 11:49
  • @Kukeltje Of course at first `src/main/resources` folder I tried. And you if know any existing page which helps I will deleted this page as duplicate, but for now I haven't find solution. – Ashot Karakhanyan Sep 17 '18 at 11:59
  • 2
    Wow... From the duplicate (bold mine): _"Drop the CSS/JS/image files in /resources folder of the **public webcontent** as below (just create one if not already exist at the **same level** as /WEB-INF and /META-INF)."_ and _"In case of Maven, it should be in /main/webapp/resources and thus **not** /main/resources"_ So /src/main/resources is wrong and /src/main/web/resources won't work either (unless you have a specific web root config in your maven pom). And the reference in it to https://stackoverflow.com/questions/13540907/maven-and-jsf-webapp-structure-where-exactly-to-put-jsf-resources – Kukeltje Sep 17 '18 at 12:12
  • Great it works. A couple of things. In Stackoverflow answers belong in answers, not in edited questions. And regarding your 'numbered answer parts', 1: Already in the duplicate. Next time read a little better. 2: Totally not needed, this makes the files in that folder from the source end up in the classes folder in the target. 3: If you change the api, you also need to change the impl otherwise yes, there is a problem. Totally unrelated to this question. I reverted the question back to the original one before the answer – Kukeltje Sep 18 '18 at 17:51

0 Answers0