I keep getting a ClassCastException during runtime in one of my Action
classes. This is a runtime error, but it compiles cleanly. In my
application framework,  I have defined a class named ListActionForm
that extends the ActionForm.  I extend the ListActionForm with a
class named CustomerListActionForm.  The perform method is defined in
the required fashion as seen below:

        public ActionForward perform(ActionMapping mapping,
                     ActionForm   form, HttpServletRequest request,
                     HttpServletResponse response)  throws IOException,
                     ServletException { ...


The rutime error occurs on the following line of code in the
ActionClass:

        CustomerListActionForm listForm = (CustomerListActionForm) form;

The error is:

        - java.lang.ClassCastException: form.ListActionForm

I have coded Action clasess countless times, but the form handlerI use
has always been a direct
descendant of the ActionForm.  Considering that the
CustomerListActionFOrm is still an
instance of ActionForm, why does this ClassCastException keep getting
thrown?



Pete Serafin


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

Reply via email to