You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mileidys Gonzalez Prieto <mi...@i-frontier.net> on 2009/08/18 17:38:00 UTC

action class can't find setter function

Hi..

Im getting an error on my project. I just trying to send a form and 
receive the information in my action class. Im using struts 2.16.
Please, help!!! I dont know what Im missing there... or if i need to add 
another jar on the project... Im been searching for that error on 
internet without success.

Error message:
WARN  com.opensymphony.xwork2.ognl.OgnlValueStack  - Error setting value
ognl.OgnlException: target is null for setProperty(null, "relmedpckId", 
[Ljava.lang.String;@9d74b8)

----------------------------------------
My Class:
public class JspRelationMedpackage  {

    private Long relmedpckId;
    private Long relId;
    private Long medicalPackageId;
    private Long clinicId;
    private Long medstaffId;
    private Long typeAccidentsId;
    private Date relmedpckDate;
    private String relmedpckNotes;
    private String relmedpckBatchnr;
    private String relmedpckLotnr;
    private Long rowVersion;
....
    with all the getter and setters

-------------------------------------------------

public class VaccinationAddEditForm extends ActionSupport {
 ...
private RelMedpackage relMedpackage;

public RelMedpackage getRelMedpackage() {
       ....
        return relMedpackage;
    }

    public void setRelMedpackage(RelMedpackage relMedpackage) {
        this.relMedpackage = relMedpackage;
    }

-----------------------------------------------
jsp file:

<s:form id="frmVaccAddEditForm" theme="simple">
        <s:hidden name="relMedpackage.relmedpckId"></s:hidden>
        <s:hidden name="relMedpackage.relId" ></s:hidden>
       ......

-----------------------------------------------

-- 
Mileidys González Prieto
Consultant
i-Frontier www.i-frontier.net 
Address: Henck Arronstraat 16
Phone:(597) 424073  /  (597) 8810219
Fax: (597) 424093
Email: mileidys.gonzalez@i-frontier.net


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


Re: action class can't find setter function

Posted by Mileidys Gonzalez Prieto <mi...@i-frontier.net>.
wow, sometimes u really need to switch to another project... play some 
games, walk around...jejeje, after ur email and put again the breakpoint 
and then I notice that wasn't passing for that area... and of course, 
all the error was a mistake on one character on the href for the jquery 
submit button.

Thanks

Milo

Musachy Barroso wrote:
> put a breakpoint in setRelMedpackage, and see if struts is passing a
> new instance of RelMedpackage. Also make sure that class has a default
> constructor.
>
> On Tue, Aug 18, 2009 at 8:38 AM, Mileidys Gonzalez
> Prieto<mi...@i-frontier.net> wrote:
>   
>> setRelMedpackage
>>     
>
>
>
>   


-- 
Mileidys González Prieto
Consultant
i-Frontier www.i-frontier.net 
Address: Henck Arronstraat 16
Phone:(597) 424073  /  (597) 8810219
Fax: (597) 424093
Email: mileidys.gonzalez@i-frontier.net


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


Re: action class can't find setter function

Posted by Musachy Barroso <mu...@gmail.com>.
put a breakpoint in setRelMedpackage, and see if struts is passing a
new instance of RelMedpackage. Also make sure that class has a default
constructor.

On Tue, Aug 18, 2009 at 8:38 AM, Mileidys Gonzalez
Prieto<mi...@i-frontier.net> wrote:
> setRelMedpackage



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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