Skip to content

Commit 4712de0

Browse files
committed
Merge pull request javaee-samples#287 from tsabirgaliev/webjars
Add a JSF example featuring WebJars
2 parents 54d9036 + ebfa523 commit 4712de0

File tree

4 files changed

+149
-0
lines changed

4 files changed

+149
-0
lines changed

‎extra/webjars/pom.xml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectxmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.javaee7.extra</groupId>
9+
<artifactId>extra-samples</artifactId>
10+
<version>1.0-SNAPSHOT</version>
11+
<relativePath>../pom.xml</relativePath>
12+
</parent>
13+
14+
<groupId>org.javaee7.extra</groupId>
15+
<artifactId>webjars</artifactId>
16+
<version>1.0-SNAPSHOT</version>
17+
18+
<packaging>war</packaging>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.webjars</groupId>
23+
<artifactId>foundation</artifactId>
24+
<version>5.5.0</version>
25+
</dependency>
26+
</dependencies>
27+
28+
</project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app
3+
version="3.1"
4+
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
7+
<context-param>
8+
<param-name>javax.faces.PROJECT_STAGE</param-name>
9+
<param-value>Development</param-value>
10+
</context-param>
11+
<servlet>
12+
<servlet-name>Faces Servlet</servlet-name>
13+
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
14+
<load-on-startup>1</load-on-startup>
15+
</servlet>
16+
<servlet-mapping>
17+
<servlet-name>Faces Servlet</servlet-name>
18+
<url-pattern>/faces/*</url-pattern>
19+
</servlet-mapping>
20+
<session-config>
21+
<session-timeout>
22+
30
23+
</session-timeout>
24+
</session-config>
25+
<welcome-file-list>
26+
<welcome-file>faces/index.xhtml</welcome-file>
27+
</welcome-file-list>
28+
</web-app>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<htmlxmlns="http://www.w3.org/1999/xhtml"
3+
xmlns:f="http://xmlns.jcp.org/jsf/core"
4+
xmlns:h="http://xmlns.jcp.org/jsf/html"
5+
xmlns:a="http://xmlns.jcp.org/jsf/passthrough">
6+
<h:head>
7+
<metaname="viewport" content="width=device-width, initial-scale=1.0" />
8+
<h:outputStylesheetname="webjars/normalize.css/3.0.1/normalize.css" />
9+
<h:outputStylesheetname="webjars/foundation/5.5.0/css/foundation.min.css" />
10+
<h:outputStylesheetname="css/app.css" />
11+
<h:outputScriptname="webjars/jquery/2.1.1/jquery.min.js" />
12+
<h:outputScriptname="webjars/foundation/5.5.0/js/foundation.min.js" />
13+
<h:outputScriptname="webjars/modernizr/2.8.3/modernizr.min.js" />
14+
</h:head>
15+
<h:body>
16+
<h1align="center">Hello Webjars + Foundation!</h1>
17+
<h:form>
18+
<divclass="row">
19+
<divclass="large-12 columns">
20+
<h:outputLabel>Input Label
21+
<h:inputTexta:placeholder="large-12.columns" />
22+
</h:outputLabel>
23+
</div>
24+
</div>
25+
<divclass="row">
26+
<divclass="large-4 columns">
27+
<h:outputLabel>Input Label
28+
<h:inputTexta:placeholder="large-4.columns" />
29+
</h:outputLabel>
30+
</div>
31+
<divclass="large-4 columns">
32+
<h:outputLabel>Input Label
33+
<h:inputTexta:placeholder="large-4.columns" />
34+
</h:outputLabel>
35+
</div>
36+
<divclass="large-4 columns">
37+
<divclass="row collapse">
38+
<h:outputLabelfor="row2col3">Input Label</h:outputLabel>
39+
<divclass="small-9 columns">
40+
<h:inputTextid="row2col3" a:placeholder="small-9.columns" />
41+
</div>
42+
<divclass="small-3 columns">
43+
<spanclass="postfix">.com</span>
44+
</div>
45+
</div>
46+
</div>
47+
</div>
48+
<divclass="row">
49+
<divclass="large-12 columns">
50+
<h:outputLabel>Select Box
51+
<h:selectOneMenu>
52+
<f:selectItemitemValue="husker" itemLabel="Husker"/>
53+
<f:selectItemitemValue="starbuck" itemLabel="Starbuck"/>
54+
<f:selectItemitemValue="hotdog" itemLabel="Hot Dog"/>
55+
<f:selectItemitemValue="apollo" itemLabel="Apollo"/>
56+
</h:selectOneMenu>
57+
</h:outputLabel>
58+
</div>
59+
</div>
60+
<divclass="row">
61+
<divclass="large-6 columns">
62+
<h:outputLabel>Choose Your Favorite</h:outputLabel>
63+
<h:selectOneRadioid="pokemon" styleClass="jsf-select">
64+
<f:selectItemitemValue="Red" itemLabel="Red"/>
65+
<f:selectItemitemValue="Blue" itemLabel="Blue"/>
66+
</h:selectOneRadio>
67+
</div>
68+
<divclass="large-6 columns">
69+
<h:outputLabel>Check these out</h:outputLabel>
70+
<h:selectManyCheckboxstyleClass="jsf-select">
71+
<f:selectItemitemLabel="Checkbox 1"/>
72+
<f:selectItemitemLabel="Checkbox 2"/>
73+
</h:selectManyCheckbox>
74+
</div>
75+
</div>
76+
<divclass="row">
77+
<divclass="large-12 columns">
78+
<h:outputLabel>Textarea Label
79+
<h:inputTextareaa:placeholder="small-12.columns"></h:inputTextarea>
80+
</h:outputLabel>
81+
</div>
82+
</div>
83+
</h:form>
84+
</h:body>
85+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.jsf-select{
2+
border:0;
3+
margin:3px00;
4+
}
5+
6+
.jsf-selecttd{
7+
padding:0;
8+
}

0 commit comments

Comments
(0)