Skip to main content

Manfred Riem

I love working with a broad range of technologies. At work it is mostly JavaEE and JavaSE technologies, as a hobby I do some Java on devices.

 

mriem's blog

MVC JSR 1.0 Snapshots

Posted by mriem on February 18, 2015 at 8:10 AM PST

The MVC JSR is progressing nicely and we have started publishing SNAPSHOT builds.

If you want to try them out grab the API JAR from https://maven.java.net/content/repositories/snapshots/javax/mvc/javax.mv... and the Implementation JAR from https://maven.java.net/content/repositories/snapshots/com/oracle/ozark/1...

JSF 2.3 Using a CDI managed Validator

Posted by mriem on January 16, 2015 at 11:38 AM PST

Just like the previous blog entry "JSF 2.3 Using a CDI managed Converter" you can now do the same thing with Validators.

So how does that look in code?

  @FacesValidator(value = "myValidator", managed = true)
  public class MyValidator implements Validator {

     @Inject
     MyModel model;
    ..
  }

JSF 2.3 Using a CDI managed Converter

Posted by mriem on January 15, 2015 at 3:27 AM PST

Although a converter is considered an attached object (part of the view state) commonly people ask support for CDI injection into a converter. Since we did not want to upset the original contract of what a converter is we had to look at how we can best support the requested use case.

Happy New Year!

Posted by mriem on January 1, 2015 at 7:22 AM PST

Happy New Year to all!

Enjoy!

Working towards the first JSF 2.3 milestone

Posted by mriem on December 24, 2014 at 8:00 AM PST

As we are working towards our first JSF 2.3 milestone release I want to tell everyone once it is out please start testing. With your help we are able to catch so much more before we ship. This is why we are going to be doing milestone releases. So once the first one is out try it out! I hope you all will make testing your JSF application with JSF 2.3 a New Years resolution!

Enjoy!

MVC and Adopt a JSR

Posted by mriem on December 19, 2014 at 12:52 PM PST

Today I participated in a phone call on Adopt-a-JSR for the MVC 1.0 specification.

While we do not have a whole lot of things that can be worked upon by a JUG at the moment I do want to point out that once we start publishing SNAPSHOT releases and milestones we will be looking forward to your contributions!

JavaEE Tip #6 - Resources

Posted by mriem on December 18, 2014 at 9:15 AM PST

The @Resources annotation makes it possible to define resources that you are going to lookup at runtime. The example describes a way to lookup a datasource that is mentioned in the @Resources annotation on the class.


@Resources(value={
@Resource(name="ShoppingCartDB", type=javax.sql.DataSource),
@Resource(name="ShoppingCartMail", type=javax.mail.Session)
})
@Stateful

JavaEE Tip #5 - Resource

Posted by mriem on December 15, 2014 at 4:57 AM PST

With the @Resource annotation you define the resource you want to inject. Note this annotation is an older style annotation. Going forward the recommendation is to use the CDI @Inject annotation.

In code

  @Resource
  UserTransaction utx;

Enjoy!

JavaEE Tip #4 - PreDestroy

Posted by mriem on December 13, 2014 at 7:29 AM PST

With the @PreDestroy annotation you annotate a single method in your class that you want to be called just before your object (EJB, JSF managed bean, CDI bean) is taken out of service.

In code

  @PreDestroy
  public void destroy() {
    // put your destroy code here.
  }

Enjoy!

JavaEE Tip #3 - PostConstruct

Posted by mriem on December 12, 2014 at 6:40 AM PST

The @PostConstruct annotation makes it possible to run initialization code just before something (EJB, JSF managed bean, CDI bean) is put into service.

In code

  @PostConstruct
  public void init() {
    // put your initialization code here.
  }