You have not allocated the Properties instance that you will use.

private Map properties = new Properties ( );


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, September 15, 2003 7:00 AM
To: Struts Users Mailing List
Subject: Map backed action form


Hello,

I have a problem with my map backed form.

When I try to validate the form, when I try to retrieve value it throws a
null pointer exception, as if the map was null.
I am successful going through my jsp and populating the bean, so i am not
sure what is going on.

What might be the problem?

form:

 private Map properties;

public Map getProperties() {
        return this.properties;
    }

    /** Setter for property properties.
     * @param properties New value of property properties.
     *
     */
    public void setProperties(Map properties) {
        this.properties = properties;
    }

    public void setValue(String key, Object value) {
        properties.put(key, value);
    }

    public Object getValue(String key) {
        return properties.get(key);
    }

struts-config definitions

<form-bean name="registerUserForm"
type="com.blah.gum.forms.RegisterUserForm"/>

<action path="/registerUser" type="com.blah.gum.actions.RegisterUser"
name="registerUserForm"
                scope="request" input="new_register.jsp">
  <forward name="success" path="/out.jsp"/>
 </action>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to