Thanks Bill, found the problem. I changed the javascript to instead set the value of a hidden field and it works. Seems that the url being as below was causing the request to be a get and not a post. That was the problem. Sohil
> function updateDisplayData(fieldName){ > document.ApplicationForm.action = > "/loa/updateApplicationData.do?changedField="+fieldName; > document.ApplicationForm.submit(); > } -----Original Message----- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow Sent: Tuesday, April 20, 2004 8:35 PM To: [EMAIL PROTECTED] Subject: Re: Form Object is null Did you specify the form in the "name" attribute of the action mapping for the "udpateApplicationData" action? If you still have problems try setting the scope of the form to session. MARU, SOHIL (SBCSI) wrote: > Hello All, > I have a page on which I have to update 2-3 fields based on value > selected by the user for another field. What I did was create an action > which I call by executing some javascript by capturing the onchange > event. Here is my struts-config.xml clip > <form-bean name="ApplicationForm" > type="com.sbc.hrtech.loa.ui.form.LoaApplicationForm"/> > ... > ... > ... > .. > <action path="/updateApplicationData" validate="false" > type="com.sbc.hrtech.loa.ui.action.UpdateApplicationDataAction" > scope="request" input="/WEB-INF/jsp/application.jsp" > name="ApplicationForm"> > <forward name="success" > path="/WEB-INF/jsp/application.jsp"/> > </action> > > In my html(actually XSL), I have the following javascript function > function updateDisplayData(fieldName){ > document.ApplicationForm.action = > "/loa/updateApplicationData.do?changedField="+fieldName; > document.ApplicationForm.submit(); > } > > However in the action class, when I try to refer to the form, I get a > null pointer exception. Any ideas what I am doing wrong? > > public ActionForward execute(ActionMapping am, ActionForm af, > HttpServletRequest req, HttpServletResponse res) > throws Exception { > HttpSession sess = req.getSession(); > ActionErrors actionErrs = new ActionErrors(); > LoaApplicationForm laf = (LoaApplicationForm)af; > --> LINE WHICH THROWS THE EXCEPTION BELOW > if(laf.validBeginDate(actionErrs) && > laf.validEndDate(actionErrs)){ > > Thanks, > Sohil --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]