
Unable to find resource css, styles.css
Publicado por mat94 (1 intervención) el 14/08/2015 21:50:16
Hola,
Estoy intentando aprender Jsf pero estoy teniendo algunos problemas (Estoy trabajando en NetBeans). Estoy usando JSF 2.2. Estoy siguiendo un libro y he copiado el siguiento codigo:
Pero cuando le doy a Run me sale el siguiente error:
Unable to find resource css, styles.css
He mirado y no tengo creada la carpeta de resources y css por ningun lado. No se si eso lo tengo que crear yo manualmente o se deberia crear de forma automatica.
Un saludo y gracias de antemano.
Estoy intentando aprender Jsf pero estoy teniendo algunos problemas (Estoy trabajando en NetBeans). Estoy usando JSF 2.2. Estoy siguiendo un libro y he copiado el siguiento codigo:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?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://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<title>Facelet Title</title>
<h:outputStylesheet library="css" name="styles.css"/>
</h:head>
<h:body>
<h3>Registration Page</h3>
<h:form>
<h:panelGrid columns="3"
columnClasses="rightalign,leftalign,leftalign">
<h:outputLabel value="Salutation: " for="salutation"/>
<h:selectOneMenu id="salutation" label="Salutation"
value="#{registrationBean.salutation}">
<f:selectItem itemLabel="" itemValue=""/>
<f:selectItem itemLabel="Mr." itemValue="MR"/>
<f:selectItem itemLabel="Mrs." itemValue="MRS"/>
<f:selectItem itemLabel="Miss" itemValue="MISS"/>
<f:selectItem itemLabel="Ms" itemValue="MS"/>
<f:selectItem itemLabel="Dr." itemValue="DR"/>
</h:selectOneMenu>
<h:message for="salutation"/>
<h:outputLabel value="First Name:" for="firstName"/>
<h:inputText id="firstName" label="First Name"
required="true"
value="#{registrationBean.firstName}"/>
<h:message for="firstName"/>
<h:outputLabel value="Last Name:" for="lastName"/>
<h:inputText id="lastName" label="Last Name"
required="true"
value="#{registrationBean.lastName}"/>
<h:message for="lastName"/>
<h:outputLabel value="Age:" for="age"/>
<h:inputText id="age" label="Age" size="2"
value="#{registrationBean.age}"/>
<h:message for="age"/>
<h:outputLabel value="Email Address:" for="email"/>
<h:inputText id="email" label="Email Address"
required="true"
value="#{registrationBean.email}">
</h:inputText>
<h:message for="email"/>
<h:commandButton id="register" value="Register"
action="confirmation"/>
</h:panelGrid>
</h:form>
</h:body>
</html>
Pero cuando le doy a Run me sale el siguiente error:
Unable to find resource css, styles.css
He mirado y no tengo creada la carpeta de resources y css por ningun lado. No se si eso lo tengo que crear yo manualmente o se deberia crear de forma automatica.
Un saludo y gracias de antemano.
Valora esta pregunta


0