Professional Documents
Culture Documents
Form
input
input
combo
command
How does Apache MyFaces work?
jar file for deployment on Tomcat or any J2EE
container – myfaces-all.jar
Controller servlet, XML config file, JSP, a pile
of base classes, and custom tags out the wazoo
(of course! just like all the other frameworks!)
MyFaces architecture
J2EE server
Faces
Servlet
my App
base classes
faces-config.xml
MyFaces Demo
I used: Eclipse, Java5, JBoss 4 (JBossIDE)
Register a user
the Bean: Registration
the view : HTML and JSP
the Action Controller
the web.xml
faces-config.xml
navigation
What is Seam?
Seam is a new product from JBoss, (OSS, free
as in beer and speech)
Founded by Gavin King, Hibernate creator
uses Java5 and EJB3
goal: use the exact same objects for
persistence and rendering the view layer:
abolish glue code and DTO objects
combines MyFaces, EJB3
Seam Demo
the Bean: User EJB3
the view : HTML and JSP
the Action: Register SSB
Seam in the faces-config.xml?
Next for Seam?
Reverse Engineering – make a whole app from
a set of database tables
Facelets
Totally replace JSPs, uses XHTML instead
Integrates tightly with JSF
faster and leaner than JSPs – same idea as
Tapestry
avoids serious JSP / JSF integration issues
Seam architecture
JSP Facelets
Seam Framework
EJB3 Hibernate3
SQL DB
Tomahawk
Apache’s extended JSF components, ships
with MyFaces
Calendar
Tree
advanced inputText
the Future
continued Component development, similar to
taglib dev with Struts
more tool dev – Eclipse plugins, GUI designers
Facelets general acceptance instead of JSP
Seam innovation from Gavin King, JBoss also
JSR 299 WebBeans just started
Shale? Will Craig McClanahan work on Shale
or just Struts 2 Action (aka Webwork)
Glossary
JSF – JavaServer Faces
JEE5 – the newest Java App Server spec, includes EJB3, JSF etc.
MyFaces – Apache’s JSF impl, completely replaces Sun’s ref impl for JSF
Tomahawk – Apache’s set of components to extend JSF, comes with
MyFaces
Facelets – replacement for JSP, interprets XML instead of JSP files to
produce web pages, integrated well with JSF
Seam – JBoss’ framework that works with JSF to provide the glue between
JSF and EJB3 to reduce lines of code, includes MyFaces, Facelets (Gavin
King’s project)
Shale – Apache Struts (Craig McClanahan) framework to provide a better
API for JSF, competes with Seam, needs JDK5, not EJB3
Resources
JavaServer Faces by Hans Bergsten, OReilly
http://java.sun.com/javaee/javaserverfaces/
http://www.coreservlets.com/JSF-Tutorial/
http://www.jboss.com/products/seam
http://docs.jboss.com/seam/reference/en/html/tutorial.html
http://struts.apache.org/struts-shale/index.html
http://www.jsfcentral.com/articles/facelets_1.html
Questions?
contact: Jay Meyer jmeyer@harpoontech.com