writing data to a model

I'm trying to retrieve the data from a display field and write it to a model so

that the page I forward to can then retreive this data from the model and

display it in some static text fields which are bound to the model. Note that

the forwarding page (the first one) is not bound to the model for any of its

fields since they're pure input fields from the user. Note, also, that the

model

is stored in the session through the ModelManager class.

I have getters and setters in the model. It seems that I can't just use a

setter

method from my first page because then when I retrieve this data, I get a null

pointer exception and the page doesn't render any more.

What is the proper way to do this and do you have any code examples?

Thanks.

Belinda

[871 byte] By [Guest] at [2007-11-25 9:29:00]
# 1

Belinda--

> I'm trying to retrieve the data from a display field and write it

to a model so

> that the page I forward to can then retreive this data from the

model and

> display it in some static text fields which are bound to the model.

Note that

> the forwarding page (the first one) is not bound to the model for

any of its

> fields since they're pure input fields from the user. Note, also,

that the model

> is stored in the session through the ModelManager class.

What version of JATO are you using? There is a bug with asking the

ModelManager to put models in session in JATO 1.1.

> I have getters and setters in the model. It seems that I can't just

use a setter

> method from my first page because then when I retrieve this data, I

get a null

> pointer exception and the page doesn't render any more.

This should be a fine technique. This may be related to the session

bug I mentioned above, or maybe some other confusion of model

instances. Some other questions: how are your setters storing values

in the model? What superclass does your model derive from?

Todd

Guest at 2007-7-1 16:34:48 > top of Java-index,Development Tools,Java Tools...