struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashish Kulkarni <kulkarni_ash1...@yahoo.com>
Subject HELP Has anyone tried to extend DynaValidator form and populate values in it
Date Thu, 16 Jan 2003 03:53:36 GMT
Hi, 
I am trying to do the following,
I have one CommonForm which extends DynaValidatorForm 
The i have a DispatchAction class which populates the
value for CommonForm and stores it is request and then
forwards it to a jsp,
Then in the jsp i have defined a bean with request
scope, and then use the bean to display value in text
field
But I am getting "Null pointer exception" while
loading this page, 
I am giving below all the snippets of my code please
help
my form definiation
public class CommonForm extends DynaActionForm
implements Serializable
{
private String  input1;
    public void setInput1(String input1)
    {
        this.input1 = input1;
    }
    public String getInput1()
    {
        return this.input1;
    }
}

then in my DispatchAction class i do the following
CommonForm commonForm = new CommonForm();
commonForm.setInput1("This is test");
request.setAttribute("PL1820UpdateForm", commonForm);

this is my jsp code
<jsp:useBean id="PL1820UpdateForm"
class="com.pfizer.maps.form.CommonForm"
scope="request">
</jsp:useBean>

<html:hidden name="PL1820UpdateForm" property="input1"
write="true"/>

But if i do 
 System.out.println(PL1820UpdateForm.getInput1()  );
I get the value

The error message

at
org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:1138)
	at
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:751)
	at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:780)
	at
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:728)
	at
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:193)
	at
org.apache.jsp._PL1820Update._jspService(_PL1820Update.java:352)




=====
A$HI$H

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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


Mime
View raw message