Really F'Struts'trated!!!

D

Donny

Hello all ...

I've been stuck with this problem for quite some time now.. I have
a form, say personal.jsp . It has a couple of <html:text> fields ...
I populated the fields from the database using the forms reset()
method.

The "success" page is the personal.jsp itself. The changes i make
are reflected in the database, but when the form comes back.. it still
has the old values which were originally shown the first time i
populated it from the database.

I was assuming that the forms reset() method is called every time
the form is reloaded.. What is the 'Struts' way to do this?

Thanks in advance for your help ...
 
R

Russ Perry Jr

I've been stuck with this problem for quite some time now.. I have
a form, say personal.jsp . It has a couple of <html:text> fields ...
I populated the fields from the database using the forms reset()
method.

The "success" page is the personal.jsp itself. The changes i make
are reflected in the database, but when the form comes back.. it still
has the old values which were originally shown the first time i
populated it from the database.

I was assuming that the forms reset() method is called every time
the form is reloaded.. What is the 'Struts' way to do this?

I'm pretty sure the reset() method is only called when the page is created,
though someone here might correct that.

Given what you want to do, you should either move the database access to
the getFieldName() methods, or call the reset() explicitly when you're
about to forward to the "success" page.

(But YMMV -- I'm still pretty new to Struts too)
 
D

Dirk Michaelsen

Hi,
I'm pretty sure the reset() method is only called when the page is created,
though someone here might correct that.

no, the reset() method is called everytime the jsp is reloaded. I have
proved that on my application with the logger.

cu
Dirk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top