Thanks Josh.  

With your idea in mind I dug deeper into what Weld's support for Wicket
In the Weld download is a jar called weld-wicket.jar that has a
WeldApplication class for doing what you suggest.  However following the
instruction for using their integration code only got me an error when
including their jar in my project.


So I included the weld-wicket code in my simple project to see what was
going on.  Their integration solution provides a new RequestCycle class
called WeldRequestCycle.  In this class they attempt to preserve a long
running conversation through weld/wicket trickery.  There's a line of
code in a few places that causes a runtime exception that stops the
request cycle.

ConversationContext conversationContext =

These are Weld classes, but stepping through the debugger shows it goes
go back through the Wicket filter.  Therefore I don't know who is at
fault here.  Maybe something in Wicket changed that is causing Weld to
croak or Weld in Glassfish is the culprit.  Either way I really don't
care about long running conversation support at this point so I removed
the class and any dependency on it in my modified version of the
weld-wicket code base.

With that exception out of the way and changing my application to
subclass from WeldApplication, I have simple injection working with
Weld.  Yippee!  I'll cross my fingers there are no other side effects.

Problem is now what?  I guess I can post this with the Seam/Weld team
and hope someone updates the Weld-Wicket integration.  Or I can hope
someone from the Wicket team will take a look and see if it's something
in the latest version of Wicket that caused this to break and could do a

Anyone? :)


-----Original Message-----
From: Josh Chappelle [] 
Sent: Friday, March 26, 2010 2:59 PM
Subject: RE: Wicket and JEE6


Try taking a look at the addComponentInstantiationListener method on the
Application class. It takes one parameter of type
IComponentInstantiationListener and that interface has one method which
onInstantiation(Component component). Every time a component gets
instantiated it will be handed to this listener so maybe you can write
own dependency injection code there. I would think that is what the
WeldApplication is doing under the covers but since it isn't working for
then you may have more luck just writing it yourself. The other trick is
making this work is obtaining a reference to your weld context. I use
so I'm not familiar with what it takes with Weld.

I hope this helps.



-----Original Message-----
From: Ericksen, Mark W (IS) [] 
Sent: Friday, March 26, 2010 11:52 AM
Subject: Wicket and JEE6



I'm building a new java project using all JEE6 technologies.  That means
I'm using JPA, CDI, and JSF2 for example. Each layer came together great
with fully annotated classes until I got to the JSF2 layer which drove
me crazy because JSF wants to mess with HTML element ids and names.   In
looking for alternative view layers I came across Wicket.  The
technology seems great in terms of its philosophy to keep presentation
code separate, except I'm not finding much information about its support
for JEE6 technologies.


In particular searches for support for CDI (aka WebBeans, aka Weld) only
got me to an old example in the Seam project.  I cannot find any current
references to using Weld within a Wicket project where I can use
annotations such as @Inject, @Named, @ApplicationScoped, etc.  


So my very first question for this list of experts is this:  Is there
currently any support for Weld in Wicket?  Downloading the Weld project
from JBoss, I included the weld-wicket.jar into my project and my
application is subclassed from WeldApplication.  No such luck.  Any
class injected using @Inject is still null.


I am using GlassFish v3 which has all the JEE6 goodies included.
Developing with Eclipse.


Any help is *greatly* appreciated!





To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to