InfoQ

News

Article: Developing Portlets using JSF, Ajax, and Seam (Part 2 of 3)

Posted by Ryan Slobojan on Aug 25, 2008 04:00 AM

Community
Java
Topics
Portal/CMS
Tags
RichFaces ,
JSR 301 ,
AJAX ,
JBoss Portlet Container ,
JBoss Portal ,
JSF ,
JBoss Portlet Bridge

This article, the second in a three-part series by Wesley Hales, expands upon the previous article by introducing RichFaces. It covers integrating RichFaces into the previous sample application, deploying a RichFaces portlet, and several features and capabilities of RichFaces.

From the article:

One thing I will explain before we get started is the difference in JBoss Portal installations between this article and the previous one. In the last article we deployed to a JBoss App Server running the lightweight Portlet Container 2.0 demo. Since that article was published, we have released JBoss Portal 2.7 as a beta. This combines the old JSR-168 implementation of JBoss Portal with the new Portlet 2.0 implementation, giving us the ability to run 1.0 and 2.0 portlets in the standard JBoss Portal project. So if keeping track of what version you should be using seems confusing, it's not. Just keep in mind that JBoss Portal 2.7 is the ultimate combination of everything we have to offer and versions 2.6.x are the supported stable releases that only support JSR-168 (portlet 1.0).

Read the full article here.

Excellent series so far! by John Haselden Posted Aug 25, 2008 5:35 AM
Please provide an example to use JBoss Portal services with a4J by vineet tripathi Posted Dec 22, 2008 9:03 AM
avoid "unable to locate current JTA transaction" for a4j & portal services by vineet tripathi Posted Dec 23, 2008 9:04 AM
  1. Back to top

    Excellent series so far!

    Aug 25, 2008 5:35 AM by John Haselden

    Thanks Wesley, this has proven to be a great series of articles so far and has arrived just at the right time for the project I'm working on! I can't wait for the third installment.

    John
    Thinking in Seam

  2. The sample application is wonderful to start with implementation of ajax on JSF portlet with JBoss portal. But when i send an ajax request using a4j to a bean action that uses Jboss -portal services , such as instanceContainer, PortalObjectContainer or userModule, i get an exception that says: org.hibernate.HibernateException: Unable to locate current JTA transactio Please provide an example that uses these services with ajax.

  3. I got the solution for using JBoss portal services with a4j. The following is the solution 1)You need to demarcate your action with a JTA transaction: /* * * Start transaction */ boolean isNewTransaction = true; InitialContext ctx=null; UserTransaction tx=null; try{ ctx = new InitialContext(); tx = (UserTransaction)ctx.lookup("UserTransaction"); System.out.println("transaction tx is>>>>>>>>>>>>>"+tx); tx.begin(); }catch(Exception e){ System.out.println("Exception occured>>>>>>"+e.getMessage()); isNewTransaction = false; // e.printStackTrace(); } /* * * Start transaction end */ /***Perform your actions by calling the JBoss portal services ****/ /**commit the transaction * */ if(isNewTransaction){ try{ tx.commit(); System.out.println("Transaction commited *********************"); }catch(Exception e){ // log.info("Exception occured"); System.out.println("Exception>>>>>>"+e.getMessage()); } } /** * commit the transaction */ If you are creating or destroying a portal object you need to load the object using following method to sync up your VO with Db: portalObjectContainer.getObject(objectId);

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.