This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.koenighotze</groupId> | |
<artifactId>jee7helloworld</artifactId> | |
<packaging>war</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<name>jee7helloworld Maven Webapp</name> | |
<url>http://maven.apache.org</url> | |
<dependencies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> | |
<servlet> | |
<servlet-name>Faces Servlet</servlet-name> | |
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> | |
<load-on-startup>1</load-on-startup> | |
</servlet> | |
<servlet-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html | |
xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:jsf="http://xmlns.jcp.org/jsf"> | |
<body> | |
<form jsf:id="form"> | |
What is your name: <input type="text" jsf:value="#{hello.name}"/> | |
<input type="submit" value="Greet me" jsf:action="hello.xhtml"/> | |
</form> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<body> | |
Hello #{hello.name} | |
<br/> | |
<a href="index.xhtml">Back</a> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hello; | |
import javax.enterprise.inject.Model; | |
import java.io.Serializable; | |
@Model | |
public class Hello implements Serializable { | |
private String name; | |
public String getName() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hello; | |
import javax.enterprise.context.ApplicationScoped; | |
import javax.inject.Inject; | |
import javax.inject.Named; | |
import javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
import javax.persistence.criteria.CriteriaQuery; | |
import javax.transaction.Transactional; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html | |
xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:jsf="http://xmlns.jcp.org/jsf"> | |
<body> | |
<form jsf:id="form"> | |
What is your name: <input type="text" jsf:value="#{hello.name}"/> | |
<input type="submit" value="Greet me" jsf:actionListener="#{helloController.storeName(hello)}" jsf:action="hello.xhtml"/> | |
</form> | |
<br/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> | |
<persistence-unit name="JEE7HelloWorld-Booking" transaction-type="JTA"> | |
<properties> | |
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/> | |
</properties> | |
</persistence-unit> | |
</persistence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Named | |
@ApplicationScoped | |
@Path("hello") | |
public class HelloController { | |
@Inject | |
private Hello hello; | |
@PersistenceContext | |
private EntityManager em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@javax.ws.rs.ApplicationPath("rest") | |
public class Application extends javax.ws.rs.core.Application { | |
} |
OlderNewer