You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Met @ Uber" <me...@uberstats.com> on 2003/05/07 02:38:33 UTC

ActionForm

I'm attempting to build an extremely small ActionForm with no luck. 
Here's the breakdown.

My ViewContact action has a form on it which is built using the Struts
<html> taglib.  The action element for that form posts to the
ViewContactStatus action.  That page simply takes the forms contents and
emails them out.  Somewhere in there I'd like to setup a ContactForm
class I've written which extends ActionForm.  The point of ContactForm
would be to simply validate the data on the form before submission.  

How might I go about setting this up?  I can't find a simple explanation
on-line.  Help would be greatly appreciated.

~ Matthew


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


RE: ActionForm

Posted by "Met @ Uber" <me...@uberstats.com>.
I've added the validate="true" option into my struts-config for both
actions ViewContact and ViewContactStatus.  Something definitely appears
to be happening because when I load up ViewContact I get an error inside
of my JSP page when trying to view it.  However, to my knowledge I'm not
evening using the ContactForm within the JSP page, so I'm confused.  If
someone would look over the following and give suggestions it would be
appreciated.

Here's my two action definitions.

    <action    path      = "/ViewContact"
               type      = "com.thepaperclipse.action.ViewContact"
               name      = "ContactForm"
               scope     = "request"
               validate  = "true"
               input     = "paper.contact">
        <forward name="Success" path="paper.contact" />
        <forward name="Failure" path="paper.contact" />
    </action>                                                           
    <action    path      = "/ViewContactStatus"
               type      = "com.thepaperclipse.action.ViewContactStatus"
               name      = "ContactForm"
               scope     = "request"
               validate  = "true"
               input     = "paper.contact.status">
        <forward name="Success" path="paper.contact.status" />
    </action>

The error when trying to load ViewContact is the following: 
  
  [ServletException in:/tiles/contact.jsp] Cannot retrieve definition 
  for form bean ContactForm'

The file contact.jsp is attached.  Thanks in advance,

~ Matthew

On Tue, 2003-05-06 at 21:08, Mike Jasnowski wrote:
> Specify "validate='true'" in your action mapping for ViewContactStatus, then
> in validate() method of ContactForm you can do your validation.  You can
> also use the Validator framework to perform validation of the ContactForm as
> well.
> 
> -----Original Message-----
> From: Met @ Uber [mailto:met@uberstats.com]
> Sent: Tuesday, May 06, 2003 8:39 PM
> To: Struts Users
> Subject: ActionForm
> 
> 
> I'm attempting to build an extremely small ActionForm with no luck.
> Here's the breakdown.
> 
> My ViewContact action has a form on it which is built using the Struts
> <html> taglib.  The action element for that form posts to the
> ViewContactStatus action.  That page simply takes the forms contents and
> emails them out.  Somewhere in there I'd like to setup a ContactForm
> class I've written which extends ActionForm.  The point of ContactForm
> would be to simply validate the data on the form before submission.
> 
> How might I go about setting this up?  I can't find a simple explanation
> on-line.  Help would be greatly appreciated.
> 
> ~ Matthew

RE: ActionForm

Posted by Mike Jasnowski <mj...@bea.com>.
Specify "validate='true'" in your action mapping for ViewContactStatus, then
in validate() method of ContactForm you can do your validation.  You can
also use the Validator framework to perform validation of the ContactForm as
well.

-----Original Message-----
From: Met @ Uber [mailto:met@uberstats.com]
Sent: Tuesday, May 06, 2003 8:39 PM
To: Struts Users
Subject: ActionForm


I'm attempting to build an extremely small ActionForm with no luck.
Here's the breakdown.

My ViewContact action has a form on it which is built using the Struts
<html> taglib.  The action element for that form posts to the
ViewContactStatus action.  That page simply takes the forms contents and
emails them out.  Somewhere in there I'd like to setup a ContactForm
class I've written which extends ActionForm.  The point of ContactForm
would be to simply validate the data on the form before submission.

How might I go about setting this up?  I can't find a simple explanation
on-line.  Help would be greatly appreciated.

~ Matthew


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



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