users@glassfish.java.net

problem with new Java EE firstcup tutorial from June 2010

From: <glassfish_at_javadesktop.org>
Date: Tue, 20 Jul 2010 11:46:26 PDT

i am trying out the new version of firstcup tutorial: [b]Your First Cup: 4 An Introduction to the Java EE Platform • June 2010[/b]

First, i cannot find any supplied sample code for it - I can only find code for the older version from 2006.

I built and ran the sample code from the tutorial and have a problem with the results that I am not quite sure how to fix - so i would like to compare my
code with the supplied sample if any.

the problem is that either some parm is not getting passed correctly or Duke's age is not being calculated correctly -
the same result gets returned no matter what birthdate is entered:

[b][i]You are -1 year younger than Duke![/i][/b]

Has anyone been able to get this tutorial to work correctly?
there was at least 1 error in [u]DukesBirthDayBean.java[/u] in this routine which did not compile because there was
no such constructor for [u]FirstcupUser(date,ageDifference).[/u]
However, I do not think that changing the code to
[i]FirstcupUser user = new FirstcupUser()[/i] affected the result, which is returned via the code in [u]Response.xhtml[/u] from [u]DukesBDay.ageDiff[/u]:

[b]h:outputText value="#{bundle.Younger}"
                          rendered="#{DukesBDay.ageDiff lt 0}"[/b]

 [b]//**code in DukesBirthDayBean.java
// create and store the user’s birthday in the database
  // FirstcupUser user = new FirstcupUser(date, ageDifference);
          FirstcupUser user = new FirstcupUser();
                     em.persist(user);
        logger.info("Final ageDifference is: " + ageDifference);
        return ageDifference;
    }[/b]
 

[b][/b]
[Message sent by forum member 'cscs010']

http://forums.java.net/jive/thread.jspa?messageID=478120