4
You can add CSS or Javascript like this:
<link rel="stylesheet" href="#{facesContext.externalContext.requestContextPath}/resources/css/bootstrap.css" />
More about Facescontext
Faces Context used when we want to access information related to the processing of each JSF request and the rendering of the corresponding response.
Note 1: The question is focused on the JSF 2.2
, but applies the other versions as well.
Note 2: I didn’t realize that AP was using Maven, if the folders are in the right place(webapp folder) it is also possible to do this way:
<h:outputStylesheet library="css" name="index.css" />
A small observation, ss Assets should not be in the directory Resources, but in webapp. The directory change along with the @Wellingtonavelino response, worked.
– user6406
I didn’t realize you were using Maven.
– Wellington Avelino