Ajax in Enterprise Portals
Wesley Hales is:
• JBoss Portal Lead UI Guy
• Author of InfoQ article series:
Developing Portlets using JSF, Ajax, and Seam
• JBoss Portlet Bridge project lead
• JSR-301 Expert Group member
• Your experience with portals?
• What do you want to gain from this
Portals & Portlets
What is a Portal?
• Windows that provide
access to web
applications and other
• Works across organizational boundaries to
aggregate content coming from various web
technologies: JSF, Seam, OpenSocial, Wicket,
Portals & Portlets
• Are managed by a
• Portlet windows are
aggregated via a portal
• A Portlet Application is also a Web Application. The
Portlet Application may contain servlets and JSPs in
addition to portlets. Portlets, servlets and JSPs may
share information through their session.
Portlet Ajax vs. Regular
Pitfalls with 1.0 portlets
• portlet URL’s point to the portal, not to the portlet
• You cannot make asynchronous calls to portlets through portlet URLs
• This results in the replaced markup being all the portal page markup
not just the portlet window fragment.
How we handle it
• Because a portlet is a Web application that can contain other
resources, such as servlets and JSP pages, you can make the
asynchronous requests to the resources that are bundled with the
Ajax gets better with Portlet 2.0
serveResource and resourceUrls
• With the newer (JSR-286) spec, we now have the
serveResource() mechanism that makes Ajax easier.
• Makes it easy to migrate existing JSR 168
• Works with existing client-side libraries
• Partial updates to the portlet’s UI
Today's Ajax Component Libraries
• What libraries are available to portlet developers?
• Do I have to use JSF?
• It is only framework (currently) with a spec backing it
• Two of the more popular libraries for JSF are:
• Uses custom built bridge
• Works with a JSR-301 based bridge
What is a Bridge, and why do we
• There are different bridges to handle many different web
• Spring MVC
• A bridge is often just a portlet written to handle the web
application processing and lifecycle.
Other component libraries, like IceFaces, provide their own quot;bridgequot; or way to
handle the portlet and JSF lifecycles.
View IceFaces Component Demo on YouTube
IceFaces Portlet Demo
Portlet Bridge Summary
• Standards make life easier when investing in a
• Currently the JBoss Portlet Bridge supports any
combination of JSF, Seam, and RichFaces to run
inside a portlet.
• It is currently in Beta 4 and should be approaching
GA sometime in early '09 wen the spec is ﬁnalized.
• JSR 301 scheduled to be complete early ’09 (168)
The Portal is “the glue” that holds all of the portlet
What if each portlet uses it’s own library?
• YUI, jQuery, Prototype and yajf...
• Conﬂicts and collisions
• Namespaced libraries
Mashups and OpenSocial Portlets
• Who is doing it?
• Are there any portlets available that make
View Quickstart Demo on YouTube
QuickStart Portlet Demo