You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Arpan <ar...@gmail.com> on 2014/11/26 12:36:32 UTC

Null values for Nested object properties after Form submission.

Hi,

I have a nested bean object, whose properties I am able to load in my jsp
and I can see the values.
But after Form submission, I am getting null values of the properties of
the nested object in my action.
I am implementing ModelDriven<ConfigBean> interface.
ConfigBean has 'application' as its nested bean, which has 'portNumber'
property.
I am using all the getter and setter methods.

<s:textfield name="application.portNumber" />

Can anyone suggest anything.

Thanks
Arpan

Re: Null values for Nested object properties after Form submission.

Posted by Arpan <ar...@gmail.com>.
Hi Lukasz,

I have changed accordingly and values are populating properly.
Thank you for that link.

Cheers

On Wed, Nov 26, 2014 at 10:01 PM, Lukasz Lenart <lu...@apache.org>
wrote:

> 2014-11-26 17:26 GMT+01:00 Arpan <ar...@gmail.com>:
> > Hi Lukasz,
> >
> > Even after adding no-arg constructor, the properties of  nested
> > object(application) remains null.
> > But I am getting values of the properties of upper level object
> > 'ConfigBean' properly.
> >
> > Is there anything I am missing!
>
> Yeah... 'application' is an excluded pattern ;-)
>
>
> https://github.com/apache/struts/blob/266f83f15ca8338047a0bdb34a38ebfc8c894a6a/xwork-core/src/main/java/com/opensymphony/xwork2/security/DefaultExcludedPatternsChecker.java#L24
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Null values for Nested object properties after Form submission.

Posted by Lukasz Lenart <lu...@apache.org>.
2014-11-26 17:26 GMT+01:00 Arpan <ar...@gmail.com>:
> Hi Lukasz,
>
> Even after adding no-arg constructor, the properties of  nested
> object(application) remains null.
> But I am getting values of the properties of upper level object
> 'ConfigBean' properly.
>
> Is there anything I am missing!

Yeah... 'application' is an excluded pattern ;-)

https://github.com/apache/struts/blob/266f83f15ca8338047a0bdb34a38ebfc8c894a6a/xwork-core/src/main/java/com/opensymphony/xwork2/security/DefaultExcludedPatternsChecker.java#L24


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Null values for Nested object properties after Form submission.

Posted by Arpan <ar...@gmail.com>.
Hi Lukasz,

Even after adding no-arg constructor, the properties of  nested
object(application) remains null.
But I am getting values of the properties of upper level object
'ConfigBean' properly.

Is there anything I am missing!

Thanks


On Wed, Nov 26, 2014 at 5:42 PM, Lukasz Lenart <lu...@apache.org>
wrote:

> 2014-11-26 12:36 GMT+01:00 Arpan <ar...@gmail.com>:
> > Hi,
> >
> > I have a nested bean object, whose properties I am able to load in my jsp
> > and I can see the values.
> > But after Form submission, I am getting null values of the properties of
> > the nested object in my action.
> > I am implementing ModelDriven<ConfigBean> interface.
> > ConfigBean has 'application' as its nested bean, which has 'portNumber'
> > property.
> > I am using all the getter and setter methods.
> >
> > <s:textfield name="application.portNumber" />
> >
> > Can anyone suggest anything.
>
> Missing default constructor of 'application' ?
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Null values for Nested object properties after Form submission.

Posted by Lukasz Lenart <lu...@apache.org>.
2014-11-26 12:36 GMT+01:00 Arpan <ar...@gmail.com>:
> Hi,
>
> I have a nested bean object, whose properties I am able to load in my jsp
> and I can see the values.
> But after Form submission, I am getting null values of the properties of
> the nested object in my action.
> I am implementing ModelDriven<ConfigBean> interface.
> ConfigBean has 'application' as its nested bean, which has 'portNumber'
> property.
> I am using all the getter and setter methods.
>
> <s:textfield name="application.portNumber" />
>
> Can anyone suggest anything.

Missing default constructor of 'application' ?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org