Even though you are pretty vague in what you write below, i have a few
pointers for you:
1) Check (and tell us) if you designed your action implements the
ModelDriven interface (guessed from you talking about getModel() below)
2) Maybe your getModel() returns an improperly initialized instance when
it is called several times. If the call chain you quote below somewhere
yields a null value, Struts2 is incapable of applying your parameter
value because it does not have an instance to set the value at.
3) The fact that the problem goes away when you restart Tomcat indicates
that the getModel() return value depends on the user's session and maybe
the value is ok when the session is fresh and the value is not ok when
you call your action repeatedly. (Again, guesswork here...)
Quoting your action source code and your model class source code would
help us helping you.
Robert
Say Jon schrieb:
Hi all,
I have been using Struts 2 for a while now and I am pulling my hair over the
following issue. At times, when my parameter name contains a period, the
Parameterinterceptor doesn't seem to be applied properly. For example I have
a parameter "userAddress.country.id" which points to
getModel().getUserAddress().getCountry().setId() right? This works most of
the time but occasionally, the value doesn't get set. I know this because my
validation keeps denying the user saying that "Country is required" when the
user have indeed chosen a country (problem because the parameter is not
applied properly). The problem goes away when I restart Tomcat.
Anyone facing the same problem? I'm using Struts 2.1.6 by the way.
Regards.
W.SayJon
Email Disclaimer:
The information contained in or attached to this email is confidential and
solely for the use of the individual or entity to whom it is addressed.
If you are not the intended recipient, please notify the sender immediately
and delete any copies of this email.
Any unauthorised disclosure, copying, distribution or any action taken in
reliance on the contents of this information is strictly prohibited and may
be unlawful.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org