posted 20 years ago
A few things you can do (there may be other approaches):
1. Put the obj bean in the session context or application context instead.
In my case, this object cannot be in Sesison context.
2. Before returning from the validate method, put the obj bean in the request context again.
Sounds nice and it would actually work because the page (diferent pages from the same Tiles definition) keeps track of this objects.
There's only one point:
It' not only one object, they're 3. I took a look at the ServletContext api and noticed a "getParameterMap()" with returns all the parameters, but it's too sory not having a "setParameterMap()". Would make things easier.
3. Make obj a form attribute instead. You can use <html:hidden> tags as needed to ensure that the initial values of obj are repopulated in the event of validate-errors-reinput.
I don't like this one very much, seems like a polution in the formbeans.
Another option sugested by other people was to set the input of this ActionForma as the Action that really sets all these parameters.
Thanks Junilu.
[ August 13, 2004: Message edited by: Leandro Melo ]
Leandro Melo
SCJP 1.4, SCWCD 1.4