Graeme Miller,

I was trying to replicate the situation that you have and I think what you 
need to do is, go to your struts-config.xml and for your specific action tag 
turn the validate to "true" if the validate() method of the form bean should 
be called prior to calling this action, or set to "false" if you do not want 
validation performed. Let me know if you need any further help.

Thanks,
Amalendu Biswas.

>From: Graeme Miller <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: RE: Moving from Struts 1.0b1 to Struts 1.0b3
>Date: Thu, 7 Jun 2001 10:21:13 +1200
>
>Unfortunately in my case the controller is not reused but the form bean is,
>meaning if I was to do this validation in the controller I would have to do
>it for every Action that uses this bean.  Thanks for the suggestion but it
>looks like I will have to stay on b1 until a more stable release of Struts
>comes out (maybe the 1.0 final release?)
>
> > -----Original Message-----
> > From: Biswas Amalendu [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, 7 June 2001 3:31 a.m.
> > To: [EMAIL PROTECTED]
> > Subject: Re: Moving from Struts 1.0b1 to Struts 1.0b3
> >
> >
> > Graeme Miller,
> >
> > As a solution you can have your controller do the validation
> > instead of
> > validating in the form bean. Let me know if you need any further help.
> >
> > Thanks,
> > Amalendu Biswas.
> >
> > >From: Graeme Miller <[EMAIL PROTECTED]>
> > >Reply-To: [EMAIL PROTECTED]
> > >To: "'[EMAIL PROTECTED]'"
> > <[EMAIL PROTECTED]>
> > >Subject: Moving from Struts 1.0b1 to Struts 1.0b3
> > >Date: Wed, 6 Jun 2001 18:07:59 +1200
> > >
> > >As no-one has provided any thoughts on this one I thought I
> > would repost
> > >and
> > >give a bit more detail on how the error is being caused.
> > >
> > >Problem: The validate(mapping, request) method on the
> > ActionForm class is
> > >not completing sucessfully in Struts 1.0b3 where it was in
> > Struts 1.0b1.
> > >
> > >Detail: This is a form that has a couple of struts file
> > upload controls on
> > >it (as well as text fields etc) so I suppose that might be
> > related somehow.
> > >The exception being thrown in the log is :-
> > >
> > >java.lang.ClassCastException:
> > >org.apache.struts.upload.MultipartRequestWrapper
> > >         at
> > >org.apache.tomcat.facade.RequestDispatcherImpl.forward(Reques
> > tDispatcherImpl
> > >.java:144)
> > >         at
> > >org.apache.struts.action.ActionServlet.processValidate(Action
> > Servlet.java:21
> > >37)
> > >         at
> > >org.apache.struts.action.ActionServlet.process(ActionServlet.
> > java:1564)
> > >         at
> > >org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
> > >         at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> > >         at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >         at
> > >org.apache.tomcat.core.ServletWrapper.doService(ServletWrappe
> > r.java:404)
> > >         at
> > org.apache.tomcat.core.Handler.service(Handler.java, Compiled
> > >Code)
> > >         at
> > >org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.
> > java, Compiled
> > >Code)
> > >         at
> > >org.apache.tomcat.core.ContextManager.internalService(Context
> > Manager.java:79
> > >7)
> > >         at
> > >org.apache.tomcat.core.ContextManager.service(ContextManager.
> > java:743)
> > >         at
> > >org.apache.tomcat.service.connector.Ajp12ConnectionHandler.pr
> > ocessConnection
> > >(Ajp12ConnectionHandler.java:166)
> > >
> > >         at
> > >org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java,
> > >Compiled Code)
> > >         at
> > >org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadP
> > ool.java,
> > >Compiled Code)
> > >         at java.lang.Thread.run(Thread.java:479)
> > >
> > >Does anyone have any ideas?  This one has got me totally stumped and
> > >without
> > >a solution we will have to remain on Struts 1.0b1.
> > >
> > >Thanks in advance,
> > >
> > >Graeme.
> > >
> > >-----Original Message-----
> > >From: Graeme Miller [mailto:[EMAIL PROTECTED]]
> > >Sent: Tuesday, 5 June 2001 5:02 p.m.
> > >To: '[EMAIL PROTECTED]'
> > >Subject: Moving from Struts 1.0b1 to Struts 1.0b3
> > >
> > >
> > >Currently having a problem with migrating code from using
> > Struts 1.0b1 to
> > >Struts 1.0b3
> > >
> > >Everything seems to work fine apart from the fact that the
> > validate methods
> > >on our form beans (ie subclasses of
> > org.apache.struts.action.ActionForm) no
> > >longer get called successfully.  I have had a look through
> > the release
> > >notes
> > >and cannot find any reasons why these methods would no longer work.
> > >
> > >Any ideas people?  The following error is what gets thrown
> > in the tomcat
> > >log.
> > >
> > >java.lang.ClassCastException
> > >         at
> > >org.apache.tomcat.facade.RequestDispatcherImpl.forward(Reques
> > tDispatcherImpl
> > >.java, Compiled Code)
> > >         at
> > >org.apache.struts.action.ActionServlet.processValidate(Action
> > Servlet.java,
> > >Compiled Code)
> > >         at
> > >org.apache.struts.action.ActionServlet.process(ActionServlet.
> > java, Compiled
> > >Code)
> > >         at
> > >org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
> > >         at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> > >         at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >         at
> > >org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java,
> > >Compiled Code)
> > >         at
> > org.apache.tomcat.core.Handler.service(Handler.java, Compiled
> > >Code)
> > >         at
> > >org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.
> > java, Compiled
> > >Code)
> > >         at
> > >org.apache.tomcat.core.ContextManager.internalService(Context
> > Manager.java,
> > >Compiled Code)
> > >         at
> > >org.apache.tomcat.core.ContextManager.service(ContextManager.
> > java, Compiled
> > >Code)
> > >         at
> > >org.apache.tomcat.service.connector.Ajp12ConnectionHandler.pr
> > ocessConnection
> > >(Ajp12ConnectionHandler.java, Com
> > >piled Code)
> > >         at
> > >org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java,
> > >Compiled Code)
> > >         at
> > >org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadP
> > ool.java,
> > >Compiled Code)
> > >         at java.lang.Thread.run(Thread.java:479)
> > >
> > >Thanks in advance.
> > >Graeme.
> >
> > _________________________________________________________________
> > Get your FREE download of MSN Explorer at http://explorer.msn.com
> >

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

Reply via email to