struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Instancia the bean
Date Wed, 03 Jan 2018 06:22:34 GMT
2018-01-02 22:38 GMT+01:00 José Antonio Delgado Trujillo <jadtmat@gmail.com>:
> If you have a form linked to a bean using key attribute, then when you submitted, must
you instantiate the bean before the call action populate the properties? Or Strust2 instantiate
automatically after you call the action.
>
> <form action=“a”>
>         <s:textField key=“bean.t”/>
> <submit/>
>
> //The method execute of the A class action
>
> public class A extends AcctionSupport{
>     private Object bean;
>
>     public String void execute(){
>         //Call business logic method
>         control(bean);
>         return SUCCESS;
>     }
> }
>
> This throws a NullpointerException???

Do you have a setter and getter setBean/getBean ?
Does the bean have a default contructor?
And I assume the type is not Object as Object doesn't have a property "t"


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


Mime
View raw message