Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning on JSF2 and JavaScript - JSF1064: Unable to find or serve resource

Can anybody tell me what am I doing wrong when connecting JavaScript and Css files to JSF .xhtml file. During deployment I have following warnings:

WARNING [javax.enterprise.resource.webcontainer.jsf.application] (http-/127.0.0.1:8080-1) JSF1064: Unable to find or serve resource, styles.css, from library, css.

WARNING [javax.enterprise.resource.webcontainer.jsf.application] (http-/127.0.0.1:8080-1) JSF1064: Unable to find or serve resource, checkPassword.js, from library, javascript.

index.xhml code:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html">
    <h:head>
    <title>#{msgs.windowTitle}</title>

    <h:outputStylesheet library="css" name="styles.css"/>
    <h:outputScript library="javascript" name="checkPassword.js"/>

    </h:head>
    <h:body>
        <h:form>
            <h:panelGrid columns="2" columnClasses="evenColumns, oddColumns">
                #{msgs.namePrompt}
                <h:inputText/>
                #{msgs.passwordPrompt}
                <h:inputSecret id="password"/>
                #{msgs.confirmPasswordPrompt}
                <h:inputSecret id="passwordConfirm"/>
            </h:panelGrid>
    <h:commandButton type="button" value="Submit Form"
                     onclick="checkPassword(this.form)"/>
        </h:form>
    </h:body>
    </html>

Thanks

like image 760
user3793667 Avatar asked Jul 01 '14 11:07

user3793667


1 Answers

you need to ensure that the css/styles.css file is been placed in the /resources subfolder of the public webcontent.

Example

WebContent
-- resources
   -- css
      -- styles.css
like image 142
user2618704 Avatar answered Sep 23 '22 14:09

user2618704