Skip to content

Commit 159f110

Browse files
author
=
committed
did some testing with jsf pages
1 parent b839bb6 commit 159f110

File tree

6 files changed

+111
-1
lines changed

6 files changed

+111
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.thenaglecode.jsf;
2+
3+
import javax.faces.bean.ManagedBean;
4+
5+
/**
6+
* Created with IntelliJ IDEA.
7+
* User: jxnagl
8+
* Date: 7/31/13
9+
* Time: 1:58 PM
10+
*/
11+
12+
@ManagedBean(name = "main")
13+
public class MainUIController {
14+
15+
private String magic;
16+
17+
public String getHelloWorld(){
18+
return "hello world";
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.thenaglecode.jsf;
2+
3+
import javax.faces.bean.ManagedBean;
4+
5+
/**
6+
* Created with IntelliJ IDEA.
7+
* User: jxnagl
8+
* Date: 7/31/13
9+
* Time: 2:48 PM
10+
*/
11+
@ManagedBean(name = "navigationController")
12+
public class NavigationController {
13+
public String moveToPage1(){
14+
return "page1";
15+
}
16+
17+
public String moveToRandomGeneratorPage(){
18+
return "random";
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.thenaglecode.jsf;
2+
3+
import javax.faces.bean.ManagedBean;
4+
5+
/**
6+
* Created with IntelliJ IDEA.
7+
* User: jxnagl
8+
* Date: 7/31/13
9+
* Time: 2:58 PM
10+
*/
11+
12+
@ManagedBean(name = "random")
13+
public class Random {
14+
}

src/main/webapp/index.xhtml

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
</h:head>
1818

1919
<h:body>
20-
Place your content here
20+
#{main.helloWorld}
21+
<h:form>
22+
<h:commandButton action="#{navigationController.moveToPage1}"
23+
value="Page1" />
24+
</h:form>
2125
</h:body>
2226

2327
</html>

src/main/webapp/page1.xhtml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Created by IntelliJ IDEA.
4+
User: jxnagl
5+
Date: 7/31/13
6+
Time: 2:50 PM
7+
-->
8+
<!DOCTYPE html
9+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
10+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
11+
12+
<html xmlns="http://www.w3.org/1999/xhtml"
13+
xmlns:h="http://java.sun.com/jsf/html">
14+
15+
<h:head>
16+
<title>Simple JSF Facelets page</title>
17+
</h:head>
18+
19+
<h:body>
20+
<h1>this is page 1</h1>
21+
</h:body>
22+
23+
</html>

src/main/webapp/random.xhtml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Created by IntelliJ IDEA.
4+
User: jxnagl
5+
Date: 7/31/13
6+
Time: 2:55 PM
7+
-->
8+
<!DOCTYPE html
9+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
10+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
11+
12+
<html xmlns="http://www.w3.org/1999/xhtml"
13+
xmlns:h="http://java.sun.com/jsf/html">
14+
15+
<h:head>
16+
<title>Simple JSF Facelets page</title>
17+
</h:head>
18+
19+
<h:body>
20+
<h:form>
21+
<div>
22+
<h3>Generate the next random number:</h3>
23+
<h:commandButton action="#{navigationController.moveToRandomGeneratorPage}"
24+
value="Generate"/>
25+
</div>
26+
</h:form>
27+
</h:body>
28+
29+
</html>

0 commit comments

Comments
 (0)