dev@javaserverfaces.java.net

guessNumber example in JSF 1.1.01 & 1.2

From: Jan Hornbøll Hansen <jan.hornboll.hansen_at_gmail.com>
Date: Wed, 14 Jun 2006 20:13:13 +0200

I've been trying to learn JSF last couple of days. After reading a few
chapters in J5EE tutorial I began studying guessNumber example. I may
not understand some of the finer points of this code, but it seems like
a horrible example to learn from. I don't think I have to explain how
unfortunate it is if examples are obscure. Developers who are new to
this technology need clear examples without any unnecessary stuff.

What is this example supposed to illustrate?
I would imagine its supposed to show how UserNumberBean and
greetings.jsp and response.jsp work together. If that is the case is
MessageFactory needed in this example at all?
If MessageFactory is needed, why is it so complicated?
Why are methods that are never called included?

UserNumberBean is equally verbose and obscure.
Why minSet and maxSet attributes? Why not just set min and max to some
initial value (like Integer.MIN_VALUE & Integer.MAX_VALUE)?
What is the point of intValue method? Seems like parameter passed to
this method will allways be instanceof Integer.

As previously mentioned I may not fully understand code. I have none the
less attached my version of UserNumberBean. I hope this illustrates that
UserNumberBean can simplified considerably.

Kind Regards
Jan Hornbøll Hansen