views:

208

answers:

1

I'm trying to build an JEE6-application on Glassfish V3, using JSF 2.0, Weld, JPA2 and Maven. Now i'm having trouble getting a simple <a4j:support> running. This is the fragment of my little example. When typing something into the inputtext, the outputtext should automatically be updated. But nothing happens (not in Firefox, not in IE8).

<ui:composition 
  xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
 (...)>
<h:inputText value="#{personHome.message}">
  <a4j:support event="onkeyup" reRender="repeater"/>
</h:inputText>
<h:outputText id="repeater" value="#{personHome.message}"/>

Beside that my example doesn't work, my problem is also that i don't really understand if i need a JSF implementation (MyFaces, Richfaces, Primefaces etc.) or not to use a4j elements. Is it "built-in" in glassfish? Until now, i only have the following dependencies i think i need in for JSF:

<dependency>
  <groupId>com.sun.faces</groupId>
  <artifactId>jsf-api</artifactId>
  <version>2.0.2</version>
</dependency>

<dependency>
  <groupId>com.sun.faces</groupId>
  <artifactId>jsf-impl</artifactId>
  <version>2.0.2</version>
</dependency>

<dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-api</artifactId>
  <version>6.0</version>
  <scope>provided</scope>
</dependency>

So... what do i have to do to get Ajax4JSF running on a simple JEE-App on Glassfish? Any help is highly appreciated!

+1  A: 

(...) Is it "built-in" in glassfish?

As a Java EE 6 server, GlassFish v3 ships with a JSF 2.0 implementation (Mojarra 2.0.2 which is the RI).

Until now, i only have the following dependencies i think i need in for JSF (...)

I would also flag the JSF artifacts as provided.

As a side note, I'd mention that JSF 2.0 provides built in Ajax support using <f:ajax> (inspired by the <a4j:support> from RichFaces).

Pascal Thivent
Thanks - again ;)I was really confused because of all the different JSF implementations/libraries etc. Ok f:ajax works. Do you know a good resource where i can find out what is possible with f:ajax?I hope that it's possible to do something like "a:support" in Richfaces, which validates a form only by the validation-annotations in the model.
ifischer
Ah i just found out that f:validateBean seems to be the counterpart of a:support. Here i found a good overview:http://andyschwartz.wordpress.com/2009/07/31/whats-new-in-jsf-2/
ifischer
@yournamehere Yes, that's a good resource. Also maybe have a look at the [Java EE 6 Tutorial](http://java.sun.com/javaee/6/docs/tutorial/doc/bnarc.html).
Pascal Thivent