struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "fea jabi" <zy...@hotmail.com>
Subject Re: NullPointerException when using DynaActionForm
Date Tue, 09 May 2006 18:50:42 GMT
sorry about that. here it is.      yes, I have the action mapping right I 
guess.

<action
            path="/PrepareEligibilityAction"
            type="com.actions.PrepareEligibilityAction"
            name="NewEligibilityDynaForm"
            scope="session">
            <forward name="success" path="/pages/Eligibility.jsp" 
redirect="false"/>
        </action>

        <action
            path="/DispatchEligibilityAction"
            type="com.actions.DispatchEligibilityAction"
            name="NewEligibilityDynaForm"
            scope="session"
            parameter="method">
            <forward name="successPrev" path="/PrepareEligibilityAction.do" 
redirect="false"/>
            <forward name="successNext" path="/PrepareEligibilityAction.do" 
redirect="false"/>
            <forward name="successSave" path="/PrepareEligibilityAction.do" 
redirect="false"/>
        </action>


>From: "Michael Jouravlev" <jmikus@gmail.com>
>Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
>To: "Struts Users Mailing List" <user@struts.apache.org>
>Subject: Re: NullPointerException when using DynaActionForm
>Date: Tue, 9 May 2006 11:36:56 -0700
>
>On 5/9/06, fea jabi <zyxrm@hotmail.com> wrote:
>>         <form-bean name="NewEligibilityDynaForm"
>>type="com.formbeans.NewEligibilityForm" dynamic="true">
>>             <form-property name="name" type="java.lang.String"/>
>>             <form-property name="date" type="java.lang.String"/>
>>             <form-property name="eligibleCust" 
>>type="java.lang.ArrayList"/>
>>             <form-property name="nonEligibleCust"
>>type="java.lang.ArrayList"/>
>>             <form-property name="selectedNonEligibleCust"
>>type="java.lang.String[]"/>
>>             <form-property name="method" type="java.lang.String"/>
>>         </form-bean>
>>
>>
>>
>>
>>public class NewEligibilityForm extends DynaActionForm implements
>>Serializable {
>>
>>     public NewEligibilityForm() {
>>     }
>>
>>     /**
>>      * Resets the form bean attributes
>>      *
>>      * @param mapping - are the action mapings.
>>      * @param request - is the Servlet Request
>>      */
>>     public void reset(ActionMapping mapping,
>>                   javax.servlet.ServletRequest request) {
>>
>>     }
>>
>>}
>>
>>
>>PrepareAction
>>
>>public ActionForward execute(ActionMapping mapping,
>>                        ActionForm form,
>>                        HttpServletRequest request,
>>                        HttpServletResponse response)
>>                throws ServletException, IOException {
>>         DynaActionForm newEligibilityForm = (DynaActionForm) form;
>>
>>         newEligibilityForm.set("name", "Tom");
>>}
>>
>>Getting NullPointerException at statement
>>newEligibilityForm.set("name", "Tom");
>>
>>When I debug the code I see the newEligibilityForm is null.
>>
>>I don't see any bug in the above created formbean.
>>
>>What am I missing here? thanks.
>
>You did not post your action mapping, therefore it is hard to say what
>is wrong. Have you set name="NewEligibilityDynaForm" in the action
>mapping for PrepareAction?
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Donít just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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


Mime
View raw message