Weld tutorial – Part 3

In part 1 and part 2 of this series of articles I talked about how to use the simple injection provided by Weld. What I’ve done so far was to inject full blown beans which get instanciated by its constructor. But there is another way: a producer-consumer-relationship.

With this way of injection it is possible to really inject everything. POJOs, DB resoures like ResultSets even primitives can be injected. Read the rest of this entry »

, ,

No Comments

Weld tutorial – Part 2

Welcome to part 2 of my litte Weld tutorial. Before I start I have to point you to the PFD2 of Weld. Why? Well, the whole JSR-299 is very extensive. It is IMO nearly impossible to cover all parts of it in a few lines. Hence I’m not going into much details of Weld but just show you how to get started.

Having said that lets go to… Read the rest of this entry »

, , ,

3 Comments

Weld Tutorial – Part 1

Following my recently published article about integrating Weld with Tomcat6 here’s Part 1 of my Weld tutorial.

In this first part I want to create a really really really simple example application – the so called “Hello Weld” example. For the Non-German readers: “Hello Weld” is a litte pun. “World” is “Welt” in German which is pretty close to Weld. ;) Enough jokes for now, let’s go to work. Read the rest of this entry »

, , , ,

No Comments

Integrating JSF 2.0 and Weld with Tomcat6

While Mojarra 2.0.0 is out on the street and Weld (aka Java Contexts and Dependency Injection (JSR-299)) is reaching CR1 there’s not much content on the web about it. So I tried to give a litte tutorial how they can be integrated with Tomcat6 (Glassfish v3 and JBoss provide built in support). Read the rest of this entry »

, , ,

8 Comments

Be aware: Constants get inlined at compile time

Most books tell you that new String(“value”) should not be used since it creates two objects although only one is needed. But what the books almost never tell you is that there is one case in which you should use it: Java constants aka “public static final”. Read the rest of this entry »

,

1 Comment

Authentication via LDAP

Yesterday I was looking for a neat and clean solution for authenticating a user via LDAP. Most of the solutions I found read the user from LDAP and compared the credentials with each other. This might be useful if yohave to do other stuff with the User but just for authenticating its to bloated.

Read the rest of this entry »

,

No Comments

JSF 2: What’s new?

Ever wanted to have a complete overview of the (cool) new features of JSF 2? Well, you might be pleased by the blog entry of Andy Schwartz which gives a really terrific introduction to JSF 2. But be warned: You need a lot of time to work through the post!

What’s New in JSF 2?

, ,

No Comments

Unified EL: Method calls using parameters

What Seam (and its Extended EL) could do a long time ago standard EL can do now, too: calling methods with parameters. Assuming you have the following bean:

public class MyBean {
 public String sayHello(final String name){
  return "Hello "  + name;
 }
}

Read the rest of this entry »

, ,

6 Comments

JSR-303: Bean Validation

In the last few days I created some JPA entities which are used in a Web Application and filled by the user. So what’s next? Input validation. I don’t like JSF’s f:validator tag since it displays only one error message which might be useful if you put the error message next to the input filed. But if you display all error messages bundled on the top of the main content the messages are non-sense for the user. Read the rest of this entry »

, , ,

1 Comment

History of programming languages

I just came across James Iry’s blog which contains a “A Brief, Incomplete, and Mostly Wrong History of Programming Languages”. The article holds all of its title’s promises.

It’s fun to read so don’t miss it.

No Comments