You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shinobu Kawai <sh...@gmail.com> on 2004/09/06 11:21:58 UTC

Re: map-backed ActionForm

Hi Claudia,

> and the ActionForm:
> 
> public class ProjektDDEForm extends ActionForm{
> 
>    private Map enten;
> 
>    /** Creates a new instance of ProjektDDEForm */
>    public ProjektDDEForm() {
> 
>    }
> 
>    public Map getEnten(){
>        return enten;
>    }
> 
>    public void setEnten(Map _map){
>        enten=_map;
>    }

> In the Action-Class:
> 
> ... ProjektDDEForm form=(ProjektDDEForm)actionForm;
> 
>           Map map=form.getEnten();
>  Line 60:      Iterator it=map.keySet().iterator();

> 2004-09-06 10:19:57 StandardWrapperValve[action]: Servlet.service()
> for servlet action threw exception
> java.lang.NullPointerException
>     at
> de.vit.AdisAded.actions.ProjektDDEAction.execute(ProjektDDEAction.java:60)
Since Map#keySet() will not return null, I would say that your enten is
null.  Are you explicitly setting it via setEnten()?  If so, where?  If
not, set it before you use it.  (Or you can just initialize it on object
creation.)

Best regards,
-- Shinobu Kawai

-- 
Shinobu Kawai(shinobu.kawai@gmail.com)

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