Odd. I don't see anything obvious, but still tired. Okay, stabs in the dark:

1) what does setId(id) do, could you try "this.id = new Integer(id)" instead?
2) Is #{newUserBean.username} bound via EL anywhere that the value
could be being injected?
3) in your createNewUser() add "System.out.println(this);" and in the
EL in the result page add "<t:outputText value="#{newUserBean}" />"
and see if the head pointer is still the same (assuming you didn't
override the toString function on the bean)

-Andrew

On 8/24/06, Eurig Jones <[EMAIL PROTECTED]> wrote:
Andrew Robinson wrote:
> How about a little code example? Maybe there is something there. My
> coffee hasn't kicked in yet, so maybe just tired.
>

Ok :-)

A Request Bean

public class NewUserBean
{
    private Integer id;
    private String username;

    <...getters and setters...>

    public void createNewUser()
    {
        User user = new User();
        user.setUsername(getUsername());

        // at this point id is NULL;
        int id = whatever.save();
        setId(id);
       // id is now not null
    }
}

..Now on the request page which shows after the createNewUser() action:
I can output #{newUserBean.username} but outputting #{newUserBean.id}
gives me nothing


Hope that made sense :-)

Reply via email to