Presentation is loading. Please wait.

Presentation is loading. Please wait.

JBoss Seam Presented by Andy Nguyen Truc Pham. What is JBoss Seam? Created by Gavin King Created by Gavin King A lightweight framework for Java EE 5.0.

Similar presentations


Presentation on theme: "JBoss Seam Presented by Andy Nguyen Truc Pham. What is JBoss Seam? Created by Gavin King Created by Gavin King A lightweight framework for Java EE 5.0."— Presentation transcript:

1 JBoss Seam Presented by Andy Nguyen Truc Pham

2 What is JBoss Seam? Created by Gavin King Created by Gavin King A lightweight framework for Java EE 5.0 A lightweight framework for Java EE 5.0 Provides a consistent and easy programming model for enterprise web applications. Provides a consistent and easy programming model for enterprise web applications. Facilitates stateful web applications development. Facilitates stateful web applications development.

3 Core Components in A Web App. JSP JSP Serves as the front end Serves as the front end May call beans May call beans EJB EJB Server side component Server side component Performs business logic Performs business logic ORM ORM Converts objects to database entities Converts objects to database entities Persist to and query from databases Persist to and query from databases

4 A HelloBean example Hello ! Hello ! The current time is. Have a nice day! Please type in your user name: The current time is. Have a nice day! Please type in your user name:

5

6

7 A Seam Hello World example A user enters his/her name into a web form to say Hello to Seam A user enters his/her name into a web form to say Hello to Seam Seam saves name to database Seam saves name to database Seam displays all the names of those who had said Hello to Seam Seam displays all the names of those who had said Hello to Seam

8 Create A Data Model @Entity @Name("person") public class Person implements Serializable { private long id; private String name; @Id @GeneratedValue public long getId() { return id;} public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) {this.name = name;} } public long getId() { return id;} public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) {this.name = name;} }

9 Map the Data Model to A Web Form Please enter your name: Please enter your name: </h:form>

10 Manager Bean @Stateless @Name("manager") public class ManagerAction implements Manager { @In @Out private Person person; @Out private List fans; @PersistenceContext private EntityManager em; public String sayHello () { em.persist (person); person = new Person (); fans = em.createQuery("select p from Person p").getResultList(); return null; }

11

12 Summary Seam simplifies web application development Intergrate Java EE frameworks Intergrate Java EE frameworks Designed for stateful web applications Designed for stateful web applications Promotes the use of POJO and less XML using bijection Promotes the use of POJO and less XML using bijection Configuration by exception Configuration by exception


Download ppt "JBoss Seam Presented by Andy Nguyen Truc Pham. What is JBoss Seam? Created by Gavin King Created by Gavin King A lightweight framework for Java EE 5.0."

Similar presentations


Ads by Google