I hereby claim:
- I am koenighotze on github.
- I am koenighotze (https://keybase.io/koenighotze) on keybase.
- I have a public key whose fingerprint is 1510 007A 7168 BB97 8C1A D04F F374 030E 538F 74DC
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| <!DOCTYPE html> | |
| <html | |
| xmlns="http://www.w3.org/1999/xhtml" | |
| xmlns:jsf="http://xmlns.jcp.org/jsf" xmlns:ui="http://java.sun.com/jsf/facelets"> | |
| <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/> |
| @Model | |
| @Entity | |
| @XmlRootElement | |
| public class Hello implements Serializable { | |
| @Id | |
| private String name; | |
| public String getName() { | |
| return name; | |
| } |
| @javax.ws.rs.ApplicationPath("rest") | |
| public class Application extends javax.ws.rs.core.Application { | |
| } |
| @Named | |
| @ApplicationScoped | |
| @Path("hello") | |
| public class HelloController { | |
| @Inject | |
| private Hello hello; | |
| @PersistenceContext | |
| private EntityManager em; |
| <?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> |
| <!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/> |
| 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; |
| package hello; | |
| import javax.enterprise.inject.Model; | |
| import java.io.Serializable; | |
| @Model | |
| public class Hello implements Serializable { | |
| private String name; | |
| public String getName() { |
| <!DOCTYPE html> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <body> | |
| Hello #{hello.name} | |
| <br/> | |
| <a href="index.xhtml">Back</a> | |
| </body> | |
| </html> |