You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tom Jerry <to...@gmail.com> on 2007/01/03 14:05:33 UTC

error

why do I get this error ?

java.lang.ClassCastException: org.apache.struts.validator.BeanValidatorForm
    at com.traveldesk.actions.MyRequestAction.AddRequest(
MyRequestAction.java:49)

public ActionForward AddRequest(...)
{
    SubmitRequestForm submitRequestForm = (SubmitRequestForm)form;

}


public class SubmitRequestForm extends ValidatorForm
{
  ......
}

SInce because SubmitRequestForm is of ValidatorForm type, I cant use
(SubmitRequestForm)form ???? Please help.

Re: error

Posted by Martin Gainty <mg...@hotmail.com>.
Hi Tom
and if you implement your SubmitRequestForm with either
public class SubmitRequestForm extends BeanValidatorForm
OR
public class SubmitRequestForm extends ValidatorForm implements DynaBean, Serializable 
?
Martin --
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Tom Jerry" <to...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Sunday, January 07, 2007 11:24 AM
Subject: Re: error


> why am I not getting any reply ?
> 
> On 1/3/07, Tom Jerry <to...@gmail.com> wrote:
>>
>> why do I get this error ?
>>
>> java.lang.ClassCastException:
>> org.apache.struts.validator.BeanValidatorForm
>>     at com.traveldesk.actions.MyRequestAction.AddRequest(
>> MyRequestAction.java:49)
>>
>> public ActionForward AddRequest(...)
>> {
>>     SubmitRequestForm submitRequestForm = (SubmitRequestForm)form;
>>
>> }
>>
>>
>> public class SubmitRequestForm extends ValidatorForm
>> {
>>   ......
>> }
>>
>> SInce because SubmitRequestForm is of ValidatorForm type, I cant use
>> (SubmitRequestForm)form ???? Please help.
>>
>>
>>
>

Re: error

Posted by Tom Jerry <to...@gmail.com>.
    public ActionForward AddRequest(ActionMapping mapping,
            ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response)throws Exception
{
        ................
}

Laurie.. hope this is clear to you ?

On 1/8/07, Laurie Harper <la...@holoweb.net> wrote:
>
> Tom Jerry wrote:
> > why am I not getting any reply ?
>
> In general, because you asked a question nobody could answer. The best
> thing to do then is to try and re-formulate your question and/or provide
> additional info. In this case, the code you submitted isn't adequate to
> diagnose the problem.
>
> - what are the arguments to the AddRequest method?
> - how is that method called?
> - what is the actual type for the 'form' parameter?
> - what does your action mapping look like for the action (?) containing
> the AddRequest method?
>
> L.
>
> >
> > On 1/3/07, Tom Jerry <to...@gmail.com> wrote:
> >>
> >> why do I get this error ?
> >>
> >> java.lang.ClassCastException:
> >> org.apache.struts.validator.BeanValidatorForm
> >>     at com.traveldesk.actions.MyRequestAction.AddRequest(
> >> MyRequestAction.java:49)
> >>
> >> public ActionForward AddRequest(...)
> >> {
> >>     SubmitRequestForm submitRequestForm = (SubmitRequestForm)form;
> >>
> >> }
> >>
> >>
> >> public class SubmitRequestForm extends ValidatorForm
> >> {
> >>   ......
> >> }
> >>
> >> SInce because SubmitRequestForm is of ValidatorForm type, I cant use
> >> (SubmitRequestForm)form ???? Please help.
> >>
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: error

Posted by Laurie Harper <la...@holoweb.net>.
Tom Jerry wrote:
> why am I not getting any reply ?

In general, because you asked a question nobody could answer. The best 
thing to do then is to try and re-formulate your question and/or provide 
additional info. In this case, the code you submitted isn't adequate to 
diagnose the problem.

- what are the arguments to the AddRequest method?
- how is that method called?
- what is the actual type for the 'form' parameter?
- what does your action mapping look like for the action (?) containing 
the AddRequest method?

L.

> 
> On 1/3/07, Tom Jerry <to...@gmail.com> wrote:
>>
>> why do I get this error ?
>>
>> java.lang.ClassCastException:
>> org.apache.struts.validator.BeanValidatorForm
>>     at com.traveldesk.actions.MyRequestAction.AddRequest(
>> MyRequestAction.java:49)
>>
>> public ActionForward AddRequest(...)
>> {
>>     SubmitRequestForm submitRequestForm = (SubmitRequestForm)form;
>>
>> }
>>
>>
>> public class SubmitRequestForm extends ValidatorForm
>> {
>>   ......
>> }
>>
>> SInce because SubmitRequestForm is of ValidatorForm type, I cant use
>> (SubmitRequestForm)form ???? Please help.
>>
>>
>>
> 


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


Re: error

Posted by Tom Jerry <to...@gmail.com>.
why am I not getting any reply ?

On 1/3/07, Tom Jerry <to...@gmail.com> wrote:
>
> why do I get this error ?
>
> java.lang.ClassCastException:
> org.apache.struts.validator.BeanValidatorForm
>     at com.traveldesk.actions.MyRequestAction.AddRequest(
> MyRequestAction.java:49)
>
> public ActionForward AddRequest(...)
> {
>     SubmitRequestForm submitRequestForm = (SubmitRequestForm)form;
>
> }
>
>
> public class SubmitRequestForm extends ValidatorForm
> {
>   ......
> }
>
> SInce because SubmitRequestForm is of ValidatorForm type, I cant use
> (SubmitRequestForm)form ???? Please help.
>
>
>