Jboss Seam: Agenda
Jboss Seam: Agenda
Jboss Seam: Agenda
Andy Bosch
Independent consultant
2060
AGENDA
> Basic technologies
– What is JavaServer Faces?
– What is EJB3?
– What else? Ajax? PPR? Remoting? ...
> JBoss SEAM
– Introduction
– Features
> Case study
– Using Seam generator
– Entity Beans and Session Beans
– Injection, outjection, bijection
– Other cool features
1
3
AGENDA
> Basic technologies
– What is JavaServer Faces?
– What is EJB3?
– What else? Ajax? PPR? Remoting? ...
> JBoss SEAM
– Introduction
– Features
> Case study
– Using Seam generator
– Entity Beans and Session Beans
– Injection, outjection, bijection
– Other cool features
JavaServer Faces
> From my (subjective) point of view, JSF these days has established itself
as standard UI framework, many companies and projects are based on
it.
2
5
EJB3
> Ajax is one (if not the most important) pillar of Web 2.0
> With Ajax, server functions can be called from the browser in an
asynchronous manner.
> Cool, modern, and extremely user-friendly user interfaces (even for the
browser) can be written with Ajax.
3
7
> It becomes difficult, when the technologies are to be combined with each
other.
Sometimes it requires a lot of glue code.
> Another possibility to get and to use all the technologies mentioned
“from one source” : SEAM
AGENDA
> Basic technologies
– What is JavaServer Faces?
– What is EJB3?
– What else? Ajax? PPR? Remoting? ...
> JBoss SEAM
– Introduction
– Features
> Case study
– Using Seam generator
– Entity Beans and Session Beans
– Injection, outjection, bijection
– Other cool features
4
9
What is SEAM?
• But not only JSF and EJB3 are combined, other technologies as Ajax,
pdf generation, BPM and many more are integrated too.
10
• JBoss has submitted SEAM for standardization. The JSR 299 (WebBeans)
is currently being dealt with.
5
11
Essential properties
• SEAM is based on POJOs (with annotations).
• So there is no division into layers anymore (at least not too distinct).
12
Cool stuff
6
13
AGENDA
> Basic technologies
– What is JavaServer Faces?
– What is EJB3?
– What else? Ajax? PPR? Remoting? ...
> JBoss SEAM
– Introduction
– Features
> Case study
– Using Seam generator
– Entity Beans and Session Beans
– Injection, outjection, bijection
– Other cool features
14
Hands-on example
Here especially:
• use of the Seam generator
• injection
• data list and open-in-new-window
• conversation scope
7
15
Use of Seam-Gen
Use:
seam setup
seam new-project
seam new-form
...
16
@Name("ProductCatalog") @Name
@Scope(ScopeType.SESSION) SEAM component
@Entity
@Table(name="catalog") @Entity
public class ProductCatalogBean { EJB Entity Bean
@Id @NotNull
private long id;
@DataModel(value="choiceProducts") @DataModel
private List<ProductBean> products; see next page
...
8
17
18
@Name("ShopController") @Name
@Scope(ScopeType.SESSION) SEAM component
public class ShopController {
@In(create=true) @In
private ShoppingCart shoppingCart; Injection
shoppingCart.setProduct(prod);
return „success“;
}
...
9
19
20
<page ...>
<navigation from-action="#{startPage.update}"
evaluate="#{controller.errors.size}">
<rule if-outcome="0">
<redirect view-id="/resultPage.xhtml"/>
</rule>
</navigation>
</page>
10
21
<page view-id="/hello.jsp"
action="#{helloWorld.preparePage}"> ...
<page view-id="/hello.jsp">
<param name="vorname" value="#{person.firstName}"/>
..
22
11
23
Open-in-new-window
Initial position: A user can keep open several windows with of different
program states at the same time.
All beans with scope Conversation can thus be stored several times
within one session (per conversation).
24
• Restart of the context is not required for Xhtml pages. A restart is required
for changes in Java classes and configuration files.
12
25
- Only who has already done projects with standard JSF and Hibernate
is able to really appreciate the advantages of SEAM.
- Direct entry into SEAM without any knowledge of JSF and EJB3 is on
the one hand quite simple, but on the other hand also risky (mixture of
technologies).
26
13
27
• Application developers learn only “Seam” and do not know the basic
technologies.
28
Conclusion
• Seam works. ☺
14
Questions? Comments?
15