CDI and Bean Validation on Java EE 5 Application Server?

CDI and Bean Validation are the standard specifications of Java EE 6. However, I can use both in Java EE 5 Application Servers (as well as in Java SE) by simply adding libraries to the project.

Is it correct?

Are there any drawbacks to using both Java EE 5 application servers instead of Java EE 6 application servers?

I need to use Oracle 11 g Suite and JDeveloper. Meanwhile, JDeveloper supports JSF 2.0, but I cannot find support for Bean Validation or CDI. However, this is not a problem. There is no IDE support (for code generation, walkthrough, etc.), but I can use these libraries using a simple java editor. Right?

+4
source share
3 answers

Java EE 6 is basically a set of APIs. An application server is compatible with Java EE 6 if it implements all of these specifications. But you can still use the APIs on an Java EE 5 compatible application server. Some even put EJB on Tomcat, which is technically possible. However, it makes sense to use a compatible AS, as it also provides all the services related to the specifications.

+4
source

I think that's right.

The downside is that you are the version behind. You may need to change your code if and when you decide to upgrade to Java EE 6 (e.g. new imports, etc.)

0
source

You can easily add Apache OpenWebBeans or JBoss Weld (select one of the two CDI implementations) to your WEB-INF / lib and manually register servlet listeners in your web.xml. Voila, then you have CDI support!

For the JSR-303 Bean, Verification is a bit more complicated because it uses only JPA2 and JSF2. Therefore, you will need to add Myfaces2 and Hibernate-3.5, EclipseLink2 or OpenJPA2 to your local banks and disable the options provided by the container.

0
source

All Articles