struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Gin" <Gin.C...@NielsenMedia.com>
Subject RE: overriding DynaActionForm.reset is giving me NPE
Date Thu, 13 Mar 2003 20:33:05 GMT
You dont need to reset attributes of DynaActionForms.
So if your trying to clear your checkbox just make sure that you dont have a
default value defined for it and just call super.reset(mapping, request);
Just out of curiousity, why are you subclassing DynaActionForm unless you
have some functionality in reset or validate that you cant do using just the
Struts Validator and the struts config?

-Tim


-----Original Message-----
From: Ian Hunter [mailto:ihunter@hunterweb.net]
Sent: Thursday, March 13, 2003 2:19 PM
To: Struts Users Mailing List
Subject: overriding DynaActionForm.reset is giving me NPE


import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.action.ActionMapping;

public class MemberForm extends org.apache.struts.action.DynaActionForm {

    public void reset (ActionMapping mapping, HttpServletRequest request) {
        super.reset(mapping, request);
        set("send_emails", "");
    }
}

root cause

java.lang.NullPointerException
	at
org.apache.struts.action.DynaActionForm.getDynaProperty(DynaActionForm.java:
596)
	at
org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:412)
	at MemberForm.reset(MemberForm.java:15)
It's right on my call to set("send_emails", "") -- I'm trying to clear a
checkbox.  What am I missing?


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

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


Mime
View raw message