-
Weld 1.0.0.CR1 (formerly Web Beans) is released (26 messages)
- Posted by: Dan Allen
- Posted on: October 20 2009 10:51 EDT
The first candidate release of Weld (1.0.0.CR1) comes hot on the heels of the announcement that the reference implementation for JSR-299: Contexts and Dependency Injection for Java EE specification was renamed, both of which have been once called Web Beans. This is a major milestone; for the project and for Java EE 6, as it represents a feature complete implementation of the JSR-299 (Proposed Final Draft 2) specification. The specification, implementation and TCK are being submitted to the JCP for the Final Draft ballot. You can find some convenient download links in the official announcement or you can pull the artifacts from the Maven central repository. The reference implementation, Weld, is used in GlassFish V3 and the upcoming JBoss AS 5.2.0.Beta1 release. Weld also adds support for Servlet containers such as Tomcat and Jetty. Furthermore you may choose to use Wicket as your view layer, or perhaps Swing via the Java SE support. If you are using an OSGi container, there's a bundle for that too! There are a couple of examples in the distribution to get you started. Whether you are strictly using JSF or you're exercising the full breadth of the Java EE platform, JSR-299 promises to provide a sturdy foundation for next generation applications that ties all of your components together. Now's your chance to give it a spin!Threaded Messages (26)
- Re: Weld 1.0.0.CR1 (formerly Web Beans) is released by Reza Rahman on October 20 2009 15:36 EDT
- +1 for Wicket by Douglas Allen on October 20 2009 17:42 EDT
- Wicket and EJB by Andy Gibson on October 20 2009 20:15 EDT
- Re: Wicket and EJB by Douglas Allen on October 20 2009 09:08 EDT
- Weld in GlassFish V3 by Pete Muir on October 28 2009 10:24 EDT
- Wicket and EJB by Andy Gibson on October 20 2009 20:15 EDT
- Java Blows! by John Shuster on October 20 2009 17:57 EDT
- Re: Java Blows! by Thomas Fuller on October 21 2009 12:39 EDT
- Re: Java Blows! by Jacek Furmankiewicz on October 21 2009 14:10 EDT
- Re: Java Blows! by John Shuster on October 21 2009 06:26 EDT
- Re: Weld 1.0.0.CR1 (formerly Web Beans) is released by Guillaume Bort on October 21 2009 05:04 EDT
- Re: Weld 1.0.0.CR1 (formerly Web Beans) is released by Scott Ferguson on October 21 2009 09:32 EDT
-
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released by James Watson on October 21 2009 11:18 EDT
- Re: Weld 1.0.0.CR1 (formerly Web Beans) is released by Scott Ferguson on October 21 2009 01:09 EDT
- Re: Weld 1.0.0.CR1 (formerly Web Beans) is released by Bill Burke on October 21 2009 07:28 EDT
-
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released by Gavin King on October 22 2009 02:21 EDT
- Re: Weld 1.0.0.CR1 (formerly Web Beans) is released by James Watson on October 22 2009 09:25 EDT
-
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released by James Watson on October 21 2009 11:18 EDT
- Re: Weld 1.0.0.CR1 (formerly Web Beans) is released by Scott Ferguson on October 21 2009 09:32 EDT
- Comparisons to @ManagedBean annotations in JSF2? by Steven Boscarine on October 21 2009 17:22 EDT
- Re: Comparisons to @ManagedBean annotations in JSF2? by Reza Rahman on October 21 2009 20:07 EDT
-
When is JSR 299 preferred for JSF users? by Steven Boscarine on October 21 2009 10:04 EDT
-
CDI and the relationship to @ManagedBean by Dan Allen on October 21 2009 11:17 EDT
- Re: CDI and the relationship to @ManagedBean by alberto gori on October 23 2009 03:48 EDT
-
Re: When is JSR 299 preferred for JSF users? by Reza Rahman on October 22 2009 10:09 EDT
-
agreed by Steven Boscarine on October 22 2009 03:44 EDT
- Re: agreed by Reza Rahman on October 22 2009 08:54 EDT
-
agreed by Steven Boscarine on October 22 2009 03:44 EDT
-
CDI and the relationship to @ManagedBean by Dan Allen on October 21 2009 11:17 EDT
-
When is JSR 299 preferred for JSF users? by Steven Boscarine on October 21 2009 10:04 EDT
- Re: Comparisons to @ManagedBean annotations in JSF2? by Gavin King on October 22 2009 02:43 EDT
- Re: Comparisons to @ManagedBean annotations in JSF2? by Gavin King on October 22 2009 11:25 EDT
- Re: Comparisons to @ManagedBean annotations in JSF2? by Reza Rahman on October 21 2009 20:07 EDT
-
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released[ Go to top ]
- Posted by: Reza Rahman
- Posted on: October 20 2009 15:36 EDT
- in response to Dan Allen
Congratulations Dan and the JBoss team for doing a fantastic job with both JSR 299 and Weld! Our JSR 299 implementation, CanDI, is well on it's way too... Cheers, Reza -------------------------------------------------------------- Independent Consultant Author, EJB 3 in Action Expert Group Member, Java EE 6 and EJB 3.1 Resin EJB 3.1 Lite Container Lead -
+1 for Wicket[ Go to top ]
- Posted by: Douglas Allen
- Posted on: October 20 2009 17:42 EDT
- in response to Dan Allen
Yes!!! Now Wicket and Java EE 5 can be even closer, particularly EJB3. Thanks JCP. -
Wicket and EJB[ Go to top ]
- Posted by: Andy Gibson
- Posted on: October 20 2009 20:15 EDT
- in response to Douglas Allen
I would have thought Wicket was already the perfect match for EJB3 since EJB references are like the Detachable model that Wicket uses. You can hold on to the EJB reference which is just a stub, and when the page re-loads, the EJB stub would magically re-attach to the EJB (persistence contexts and all). I even wrote my own basic EJB injector for Wicket the other week without any problems. Great news on Weld though, for use in Glassfish would I still need to download the CR1 version or is it already up to date/updateable through the Glassfish updater? Cheers, Andy Gibson -
Re: Wicket and EJB[ Go to top ]
- Posted by: Douglas Allen
- Posted on: October 20 2009 21:08 EDT
- in response to Andy Gibson
I would have thought Wicket was already the perfect match for EJB3 since EJB references are like the Detachable model that Wicket uses. You can hold on to the EJB reference which is just a stub, and when the page re-loads, the EJB stub would magically re-attach to the EJB (persistence contexts and all). I even wrote my own basic EJB injector for Wicket the other week without any problems.
You're correct on the EJB stuff mentioned. Wicket does work with EJB3 pretty ok, and has and if you use the EJB injector anonation from the wicket-contrib-javaee-1.1.jar you will be flying. No need to mess with JNDI for EJB lookups. But as far as things like default/seamless JAAS support is concerned between the EJB container and Wicket running in the presentation layer, that's not supported since Wicket is a layer on top of low level servlets. You'll have to roll your own solution when it comes to Java EE 5 role based security for accessing protected EJB3 methods. So I'm guessing JSR 299 will help plug that gap.
Great news on Weld though, for use in Glassfish would I still need to download the CR1 version or is it already up to date/updateable through the Glassfish updater?
Cheers,
Andy Gibson -
Weld in GlassFish V3[ Go to top ]
- Posted by: Pete Muir
- Posted on: October 28 2009 10:24 EDT
- in response to Andy Gibson
You can get the Weld CR1 in any recent build of GlassFish V3, such as b70 :-)
Great news on Weld though, for use in Glassfish would I still need to download the CR1 version or is it already up to date/updateable through the Glassfish updater?
Cheers,
Andy Gibson -
Java Blows![ Go to top ]
- Posted by: John Shuster
- Posted on: October 20 2009 17:57 EDT
- in response to Dan Allen
Erlang is king -
Re: Java Blows![ Go to top ]
- Posted by: Thomas Fuller
- Posted on: October 21 2009 12:39 EDT
- in response to John Shuster
Erlang is king
What are you smoking? (and no, I don't want any) -
Re: Java Blows![ Go to top ]
- Posted by: Jacek Furmankiewicz
- Posted on: October 21 2009 14:10 EDT
- in response to John Shuster
Funny, I just finished an Erlang/OTP project. Couldn't wait to get back to a proper language like Java. Not to mention the Java performance beats Erlang...soundly. All the crap they put in their 5-year old benchmarks is just that...crap. P.S. Ever tried connecting from Erlang to an Oracle DB? Good luck. -
Re: Java Blows![ Go to top ]
- Posted by: John Shuster
- Posted on: October 21 2009 18:26 EDT
- in response to Jacek Furmankiewicz
I connect to Oracle every day: odbc:start(). {ok, Ref} = odbc:connect("DSN=sql-server;UID=aladin;PWD=sesame", []). odbc:sql_query(Ref, "CREATE TABLE EMPLOYEE (NR integer,FIRSTNAME char varying(20), LASTNAME char varying(20), GENDER char(1),PRIMARY KEY(NR))"). odbc:sql_query(Ref, "INSERT INTO EMPLOYEE VALUES(1, ’Jane’, ’Doe’, ’F’)"). Look how sexy that is! You don't need Java, JDBC or Hibernate bloated garbage. -
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released[ Go to top ]
- Posted by: Guillaume Bort
- Posted on: October 21 2009 05:04 EDT
- in response to Dan Allen
I think it is the good day to paraphrase this citation of Roy Fielding; "It even manages to one-up the previous all-time-idiocy of IBM when they renamed their CORBA toolkit "Web Services" in a deliberate attempt to confuse customers into thinking they had something to do with the Web."; as "It even manages to one-up the previous all-time-idiocy of JBoss when they renamed their Enterprise Java Beans stuff as "Web Beans" in a deliberate attempt to confuse customers into thinking they had something to do with the Web."; -
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released[ Go to top ]
- Posted by: Scott Ferguson
- Posted on: October 21 2009 09:32 EDT
- in response to Guillaume Bort
"It even manages to one-up the previous all-time-idiocy of JBoss when they renamed their Enterprise Java Beans stuff as "Web Beans" in a deliberate attempt to confuse customers into thinking they had something to do with the Web.";
I don't understand your point. JSR-299 is a Java dependency injection specification. Plenty of web applications use DI and can benefit from a DI standard. -
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released[ Go to top ]
- Posted by: James Watson
- Posted on: October 21 2009 11:18 EDT
- in response to Scott Ferguson
I'll hazard a guess. It's like calling a steak 'dog food' because a dog could eat it. Is every potential use of WebBeans necessarily part of a web app?"It even manages to one-up the previous all-time-idiocy of JBoss when they renamed their Enterprise Java Beans stuff as "Web Beans" in a deliberate attempt to confuse customers into thinking they had something to do with the Web.";
I don't understand your point. JSR-299 is a Java dependency injection specification. Plenty of web applications use DI and can benefit from a DI standard. -
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released[ Go to top ]
- Posted by: Scott Ferguson
- Posted on: October 21 2009 13:09 EDT
- in response to James Watson
I'll hazard a guess. It's like calling a steak 'dog food' because a dog could eat it. Is every potential use of WebBeans necessarily part of a web app?
True, it's now more general, which is a reason the name changed to "contexts and dependency injection". The original idea (two years ago!) was pretty heavily tied into JSF, which is a web-only technology. The current spec is a major improvement over the original ideas. -
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released[ Go to top ]
- Posted by: Bill Burke
- Posted on: October 21 2009 19:28 EDT
- in response to James Watson
This has to be *THE* lamest bashing of JSR-299 I have ever heard."It even manages to one-up the previous all-time-idiocy of JBoss when they renamed their Enterprise Java Beans stuff as "Web Beans" in a deliberate attempt to confuse customers into thinking they had something to do with the Web.";
I don't understand your point. JSR-299 is a Java dependency injection specification. Plenty of web applications use DI and can benefit from a DI standard.
I'll hazard a guess. It's like calling a steak 'dog food' because a dog could eat it. Is every potential use of WebBeans necessarily part of a web app? -
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released[ Go to top ]
- Posted by: Gavin King
- Posted on: October 22 2009 02:21 EDT
- in response to James Watson
I'll hazard a guess. It's like calling a steak 'dog food' because a dog could eat it. Is every potential use of WebBeans necessarily part of a web app?
The original purpose of the JSR was very web-application oriented. (Go read the original JSR proposal.) Therefore, the old name was extremely fitting. In the past 3 years, the spec evolved to something more general. Therefore, the new names for the spec and RI are arguably more fitting. However, there are still several features of the spec which are quite web oriented, and I expect to see 299 widely adopted in the area of web application development. -
Re: Weld 1.0.0.CR1 (formerly Web Beans) is released[ Go to top ]
- Posted by: James Watson
- Posted on: October 22 2009 09:25 EDT
- in response to Gavin King
Just to be clear. I don't really care if you call it 'WebBeans' or 'PintoBeans' or 'BrazilNuts'. I was just throwing out a theory of what someone else had an issue with.I'll hazard a guess. It's like calling a steak 'dog food' because a dog could eat it. Is every potential use of WebBeans necessarily part of a web app?
The original purpose of the JSR was very web-application oriented. (Go read the original JSR proposal.) Therefore, the old name was extremely fitting.
In the past 3 years, the spec evolved to something more general. Therefore, the new names for the spec and RI are arguably more fitting. However, there are still several features of the spec which are quite web oriented, and I expect to see 299 widely adopted in the area of web application development. -
Comparisons to @ManagedBean annotations in JSF2?[ Go to top ]
- Posted by: Steven Boscarine
- Posted on: October 21 2009 17:22 EDT
- in response to Dan Allen
While looking through the Weld examples, and the older WebBeans documentation, it looks like a competitor to the new @ManagedBean JSF 2.0 annotations. Is there any information on when we'd want to use one over the other? -
Re: Comparisons to @ManagedBean annotations in JSF2?[ Go to top ]
- Posted by: Reza Rahman
- Posted on: October 21 2009 20:07 EDT
- in response to Steven Boscarine
While looking through the Weld examples, and the older WebBeans documentation, it looks like a competitor to the new @ManagedBean JSF 2.0 annotations. Is there any information on when we'd want to use one over the other?
Steven, @ManagedBean and JSR 299 are complementary. That being said, I think @ManagedBean makes sense for applications that do not use JSR 299 or when you want to keep a level of de-coupling between JSF and JSR 299. Hope it helps, Reza ------------------------------------------------------------ Independent Consultant Author, EJB 3 in Action Expert Group Member, Java EE 6 and EJB 3.1 Resin EJB 3.1 Lite Container Lead -
When is JSR 299 preferred for JSF users?[ Go to top ]
- Posted by: Steven Boscarine
- Posted on: October 21 2009 22:04 EDT
- in response to Reza Rahman
@ManagedBean and JSR 299 are complementary. That being said, I think @ManagedBean makes sense for applications that do not use JSR 299 or when you want to keep a level of de-coupling between JSF and JSR 299.
Thanks for responding Reza. The question I was trying to get at is that @ManagedBeans handle dependency injection. My assumption is that Weld/JSR-299 provides more sophisticated features for JSF2 users. I was inquiring as to what those features might be. In particular, I was hoping someone who is more familiar with the project can provide some "bottom-line" examples that would be readily understandable by a conventional JSF user. -
CDI and the relationship to @ManagedBean[ Go to top ]
- Posted by: Dan Allen
- Posted on: October 21 2009 23:17 EDT
- in response to Steven Boscarine
It's difficult to answer this question without revealing some warts. The simple answer is that a class which is picked up as a bean by CDI implicitly has the @ManagedBean annotation. With or without the annotation, the class falls under the new managed bean specification, which is an offshoot from the Java EE 6 specification. If CDI is not present, JSF manages the life cycle of the bean. If CDI is present, then it takes over. At last, managed beans have been unified in Java EE! The trouble is that JSF still provides a dependency injection facility which is not aligned with CDI, or the rest of Java EE for that matter. The injection I speak of is declared by the @ManagedProperty annotation. What anyone from the Red Hat camp will tell you is that you should basically stop using the JSF injections and use CDI instead. Because of the way CDI is designed, it likely has a lower overhead (or, at the very least, the same). The other major issue is that the @ManagedProperty injections are not contextual, meaning they create hard references (assignments) rather than being managed by a proxy. So in the end, use @Named (to give the CDI bean an EL name) instead of @ManagedBean when using JSF in Java EE 6 (or use a Weld extension to use CDI in a servlet environment). Eventually, we will clean up the divergence in JSF, hopefully in JSF 2.1. Only so much can be solved in one iteration...and trust that there has been a lot of problem solving going on. I hope that helps! -
Re: CDI and the relationship to @ManagedBean[ Go to top ]
- Posted by: alberto gori
- Posted on: October 23 2009 03:48 EDT
- in response to Dan Allen
The other major issue is that the @ManagedProperty injections are not contextual, meaning they create hard references (assignments) rather than being managed by a proxy.
I tried to explain them that properties managed without a proxy are pretty useless. They are good only for the HelloWorld application. JSF team thinks that an old style managed property is better then nothing, but I don't think so because it introduces further useless confusion. -
Re: When is JSR 299 preferred for JSF users?[ Go to top ]
- Posted by: Reza Rahman
- Posted on: October 22 2009 10:09 EDT
- in response to Steven Boscarine
I was inquiring as to what those features might be.
Steven, I hope the responses above answered your question somewhat. Just to make sure, JSR-299 provides a much richer set of dependency injection features more in line with Spring, Guice, Seam, etc. Some key features are type-safety, qualifiers, stereotypes, producers, disposers, declarative scope/life-cycle management, an SPI (bean resolution programmatic API if you will), events, etc. That being said, it might be the case that @ManagedBean coupled with @Resource, @EJB, etc are sufficient for your purposes or is a good starting point. I do strongly suspect that you would opt to use JSR-299 if it is available. It really is a good API, you should give the spec a read for now. Once things get settled down for Java EE 6, I was planning on writing something on TSS describing JSR 299...hopefully that will help. Cheers, Reza ------------------------------------------------------------ Independent Consultant Author, EJB 3 in Action Expert Group Member, Java EE 6 and EJB 3.1 Resin EJB 3.1 Lite Container Lead -
agreed[ Go to top ]
- Posted by: Steven Boscarine
- Posted on: October 22 2009 15:44 EDT
- in response to Reza Rahman
I do strongly suspect that you would opt to use JSR-299 if it is available.
Absolutely. I am an easy sell and have no issue with it. However, I have to answer to those who pay my salary. When adding another technology to our applications, I need to justify its technical merits, especially since it would be a replacement for well established technologies, like Spring. -
Re: agreed[ Go to top ]
- Posted by: Reza Rahman
- Posted on: October 22 2009 20:54 EDT
- in response to Steven Boscarine
I need to justify its technical merits, especially since it would be a replacement for well established technologies, like Spring.
Steven, If that's the case, you might find my recent JBossWorld talk helpful as an aid to coming up with your own conclusions: http://www.redhat.com/f/pdf/jbw/rrahman_320_spring_framework.pdf. The presentation uses JSR 299 heavily. Hope it helps, Reza ------------------------------------------------------------ Independent Consultant Author, EJB 3 in Action Expert Group Member, Java EE 6 and EJB 3.1 Resin EJB 3.1 Lite Container Lead -
Re: Comparisons to @ManagedBean annotations in JSF2?[ Go to top ]
- Posted by: Gavin King
- Posted on: October 22 2009 02:43 EDT
- in response to Steven Boscarine
While looking through the Weld examples, and the older WebBeans documentation, it looks like a competitor to the new @ManagedBean JSF 2.0 annotations. Is there any information on when we'd want to use one over the other?
It's a good question, and I'm not really in full agreement with the answers that have been posted so far. The new EE Managed Beans specification defines a base component model for Java EE, together with a very basic set of container services (@Resource, @PostConstruct, @PreDestroy). The idea is that other specifications (beginning with EJB, CDI, JSF and the new Java Interceptors spec) build upon this base component model and layer additional services, for example transaction management, typesafe dependency injection, interceptors. So at this level, the managed beans, CDI, interceptors and EJB specifications all work hand-in-hand and are highly complementary. Now, the Managed Beans specification is quite open-ended with respect to identifying exactly which classes are managed beans. It does provide the @ManagedBean annotation as one mechanism, but it also allows other specifications to define different mechanisms. So, for example: * The EJB specification says that a class obeying certain programming restrictions with a @Stateless or @Stateful annotation deployed in an EJB jar is a managed bean. * The CDI specification says that any class with an appropriate constructor deployed in a "bean deployment archive" is a managed bean. Given that EJB and CDI provide arguably more convenient ways to identify a managed bean, you might wonder precisely what @ManagedBean is needed for. The answer, as alluded to by Dan, is that if you have CDI available in your environment (for example, if you are using EE6), then @ManagedBean is just not really needed. @ManagedBean is really there for use by people who are using JSF2 without CDI. OTOH, if you do annotate a bean @ManagedBean, and you do have CDI in your environment, you can still use CDI to inject stuff into your bean. It's just that the @ManagedBean annotation is not *required* in this case. To summarize, if you do have CDI available to you, it provides a *far* superior programming model to the @ManagedBean/@ManagedProperty model that JSF2 inherits from JSF1. So superior, in fact, that the EE 6 web profile does not require support for @ManagedProperty etc. The idea being that you should just use CDI instead. -
Re: Comparisons to @ManagedBean annotations in JSF2?[ Go to top ]
- Posted by: Gavin King
- Posted on: October 22 2009 23:25 EDT
- in response to Gavin King
Some relevant discussion here: http://www.seamframework.org/Community/JSR299VsManagedBeanInJSF20#comment101504