You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Roland Carlsson <ro...@swetravel.se> on 2002/11/11 11:48:21 UTC

Tiles validates ActionForm (second try)

Hi!
I didn't get any answer to my question on this topic so I'll try again.

I have an ActionForm in a page that is a part of a Tiles-definition. The problem is that the form is validated before the user have sent the form. If there are any not null checks they will present the user with errormessages that should not be presented to the user until she/he fails to fill out the form correctly and submit. 

I have tried the form without tiles and it worked perfectly. 

Is this a know error in Struts 1.1b2 and is there a way around this problem?

Thanks in advance
Roland Carlsson


Re: Tiles validates ActionForm (second try)

Posted by Roland Carlsson <ro...@swetravel.se>.
Ok, it helps a lot since it points out the way for me and removes my
missunderstandings.

Thanks
Roland


----- Original Message -----
From: "James Mitchell" <jm...@telocity.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 12, 2002 2:59 PM
Subject: RE: Tiles validates ActionForm (second try)


> Well, I'm not familiar with 'Devins Richards answer'.
>
> The most basic type of form submittal uses 2 actions, 1 action form, and 1
> jsp.
> Now, keep in mind that you could have more than this depending on what you
> are doing, but here's the basic flow:
>
>
>       #1                      #2                    #3
> /setupMyFormAction   ->   formEntry.jsp  ->  /processMyFormAction
>
>
> How you do this is all in how you setup the struts-config.
> You could have one action class that handles both of these actions or use
> separate classes.
>
> Either way, you will want to set validate="false" on the way in (#1), and
> validate="true" on the way out (#3).
>
> Hope that helps
>
>
> James Mitchell
> Software Engineer/Struts Evangelist
> http://www.open-tools.org
>
> "If you were plowing a field, which would you rather use? Two strong oxen
or
> 1024 chickens?"
> - Seymour Cray (1925-1996), father of supercomputing
>
>
> > -----Original Message-----
> > From: Roland Carlsson [mailto:roland.c@swetravel.se]
> > Sent: Tuesday, November 12, 2002 2:15 AM
> > To: Struts Users Mailing List
> > Subject: Re: Tiles validates ActionForm (second try)
> >
> >
> > I sure can. I post them below. Is Devins Richards answer the way to go
and
> > have one form that does not validate that submits to one that validates?
> >
> > Thanks in advance
> > Roland
> >
> > ------------Tiles defintion ----------
> > <definition name="/layout7/definition" page="/layout7/layout.jsp" >
> >     <put name="header" value="/layout7/header.jsp"/>
> >     <put name="footer" value="/layout7/footer.jsp"/>
> >     <put name="menu" value="/layout7/menu.jsp"/>
> >     <put name="body" value="/layout7/body1.jsp"/>
> >   </definition>
> >
> > --------- Struts action ------------
> >  <!-- Actions för exempel 7 -->
> >      <action
> >       path="/layout7/page"
> >       type="layout.EmptyAction"
> >       name="aform"
> >       input="/layout7/definition"
> >       validate="true"
> >       >
> >         <forward
> >           name="success"
> >           path="/layout7/definition" />
> >      </action>
> >
> > --------- Action info ----------
> > empty perform method
> >
> > --------Form Validate info------------
> > Does not allow null or shorter than 1.
> >
> > ---------------------------------------
> >
> >
> >
> > ----- Original Message -----
> > From: "James Mitchell" <jm...@telocity.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Monday, November 11, 2002 7:24 PM
> > Subject: RE: Tiles validates ActionForm (second try)
> >
> >
> > > Hi Roland,
> > >
> > > Could you provide a few more details about your tiles definitions and
> > action
> > > mappings?
> > >
> > > James Mitchell
> > > Software Engineer/Struts Evangelist
> > > http://www.open-tools.org
> > >
> > > "If you were plowing a field, which would you rather use? Two
> > strong oxen
> > or
> > > 1024 chickens?"
> > > - Seymour Cray (1925-1996), father of supercomputing
> > >
> > >
> > > > -----Original Message-----
> > > > From: Roland Carlsson [mailto:roland.c@swetravel.se]
> > > > Sent: Monday, November 11, 2002 5:48 AM
> > > > To: Struts Users Mailing List
> > > > Subject: Tiles validates ActionForm (second try)
> > > >
> > > >
> > > > Hi!
> > > > I didn't get any answer to my question on this topic so I'll
> > try again.
> > > >
> > > > I have an ActionForm in a page that is a part of a
> > > > Tiles-definition. The problem is that the form is validated
> > > > before the user have sent the form. If there are any not null
> > > > checks they will present the user with errormessages that should
> > > > not be presented to the user until she/he fails to fill out the
> > > > form correctly and submit.
> > > >
> > > > I have tried the form without tiles and it worked perfectly.
> > > >
> > > > Is this a know error in Struts 1.1b2 and is there a way around
> > > > this problem?
> > > >
> > > > Thanks in advance
> > > > Roland Carlsson
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tiles validates ActionForm (second try)

Posted by James Mitchell <jm...@telocity.com>.
Well, I'm not familiar with 'Devins Richards answer'.

The most basic type of form submittal uses 2 actions, 1 action form, and 1
jsp.
Now, keep in mind that you could have more than this depending on what you
are doing, but here's the basic flow:


      #1                      #2                    #3
/setupMyFormAction   ->   formEntry.jsp  ->  /processMyFormAction


How you do this is all in how you setup the struts-config.
You could have one action class that handles both of these actions or use
separate classes.

Either way, you will want to set validate="false" on the way in (#1), and
validate="true" on the way out (#3).

Hope that helps


James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

"If you were plowing a field, which would you rather use? Two strong oxen or
1024 chickens?"
- Seymour Cray (1925-1996), father of supercomputing


> -----Original Message-----
> From: Roland Carlsson [mailto:roland.c@swetravel.se]
> Sent: Tuesday, November 12, 2002 2:15 AM
> To: Struts Users Mailing List
> Subject: Re: Tiles validates ActionForm (second try)
>
>
> I sure can. I post them below. Is Devins Richards answer the way to go and
> have one form that does not validate that submits to one that validates?
>
> Thanks in advance
> Roland
>
> ------------Tiles defintion ----------
> <definition name="/layout7/definition" page="/layout7/layout.jsp" >
>     <put name="header" value="/layout7/header.jsp"/>
>     <put name="footer" value="/layout7/footer.jsp"/>
>     <put name="menu" value="/layout7/menu.jsp"/>
>     <put name="body" value="/layout7/body1.jsp"/>
>   </definition>
>
> --------- Struts action ------------
>  <!-- Actions för exempel 7 -->
>      <action
>       path="/layout7/page"
>       type="layout.EmptyAction"
>       name="aform"
>       input="/layout7/definition"
>       validate="true"
>       >
>         <forward
>           name="success"
>           path="/layout7/definition" />
>      </action>
>
> --------- Action info ----------
> empty perform method
>
> --------Form Validate info------------
> Does not allow null or shorter than 1.
>
> ---------------------------------------
>
>
>
> ----- Original Message -----
> From: "James Mitchell" <jm...@telocity.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Monday, November 11, 2002 7:24 PM
> Subject: RE: Tiles validates ActionForm (second try)
>
>
> > Hi Roland,
> >
> > Could you provide a few more details about your tiles definitions and
> action
> > mappings?
> >
> > James Mitchell
> > Software Engineer/Struts Evangelist
> > http://www.open-tools.org
> >
> > "If you were plowing a field, which would you rather use? Two
> strong oxen
> or
> > 1024 chickens?"
> > - Seymour Cray (1925-1996), father of supercomputing
> >
> >
> > > -----Original Message-----
> > > From: Roland Carlsson [mailto:roland.c@swetravel.se]
> > > Sent: Monday, November 11, 2002 5:48 AM
> > > To: Struts Users Mailing List
> > > Subject: Tiles validates ActionForm (second try)
> > >
> > >
> > > Hi!
> > > I didn't get any answer to my question on this topic so I'll
> try again.
> > >
> > > I have an ActionForm in a page that is a part of a
> > > Tiles-definition. The problem is that the form is validated
> > > before the user have sent the form. If there are any not null
> > > checks they will present the user with errormessages that should
> > > not be presented to the user until she/he fails to fill out the
> > > form correctly and submit.
> > >
> > > I have tried the form without tiles and it worked perfectly.
> > >
> > > Is this a know error in Struts 1.1b2 and is there a way around
> > > this problem?
> > >
> > > Thanks in advance
> > > Roland Carlsson
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tiles validates ActionForm (second try)

Posted by Roland Carlsson <ro...@swetravel.se>.
I sure can. I post them below. Is Devins Richards answer the way to go and
have one form that does not validate that submits to one that validates?

Thanks in advance
Roland

------------Tiles defintion ----------
<definition name="/layout7/definition" page="/layout7/layout.jsp" >
    <put name="header" value="/layout7/header.jsp"/>
    <put name="footer" value="/layout7/footer.jsp"/>
    <put name="menu" value="/layout7/menu.jsp"/>
    <put name="body" value="/layout7/body1.jsp"/>
  </definition>

--------- Struts action ------------
 <!-- Actions för exempel 7 -->
     <action
      path="/layout7/page"
      type="layout.EmptyAction"
      name="aform"
      input="/layout7/definition"
      validate="true"
      >
        <forward
          name="success"
          path="/layout7/definition" />
     </action>

--------- Action info ----------
empty perform method

--------Form Validate info------------
Does not allow null or shorter than 1.

---------------------------------------



----- Original Message -----
From: "James Mitchell" <jm...@telocity.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, November 11, 2002 7:24 PM
Subject: RE: Tiles validates ActionForm (second try)


> Hi Roland,
>
> Could you provide a few more details about your tiles definitions and
action
> mappings?
>
> James Mitchell
> Software Engineer/Struts Evangelist
> http://www.open-tools.org
>
> "If you were plowing a field, which would you rather use? Two strong oxen
or
> 1024 chickens?"
> - Seymour Cray (1925-1996), father of supercomputing
>
>
> > -----Original Message-----
> > From: Roland Carlsson [mailto:roland.c@swetravel.se]
> > Sent: Monday, November 11, 2002 5:48 AM
> > To: Struts Users Mailing List
> > Subject: Tiles validates ActionForm (second try)
> >
> >
> > Hi!
> > I didn't get any answer to my question on this topic so I'll try again.
> >
> > I have an ActionForm in a page that is a part of a
> > Tiles-definition. The problem is that the form is validated
> > before the user have sent the form. If there are any not null
> > checks they will present the user with errormessages that should
> > not be presented to the user until she/he fails to fill out the
> > form correctly and submit.
> >
> > I have tried the form without tiles and it worked perfectly.
> >
> > Is this a know error in Struts 1.1b2 and is there a way around
> > this problem?
> >
> > Thanks in advance
> > Roland Carlsson
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tiles validates ActionForm (second try)

Posted by James Mitchell <jm...@telocity.com>.
Hi Roland,

Could you provide a few more details about your tiles definitions and action
mappings?

James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

"If you were plowing a field, which would you rather use? Two strong oxen or
1024 chickens?"
- Seymour Cray (1925-1996), father of supercomputing


> -----Original Message-----
> From: Roland Carlsson [mailto:roland.c@swetravel.se]
> Sent: Monday, November 11, 2002 5:48 AM
> To: Struts Users Mailing List
> Subject: Tiles validates ActionForm (second try)
>
>
> Hi!
> I didn't get any answer to my question on this topic so I'll try again.
>
> I have an ActionForm in a page that is a part of a
> Tiles-definition. The problem is that the form is validated
> before the user have sent the form. If there are any not null
> checks they will present the user with errormessages that should
> not be presented to the user until she/he fails to fill out the
> form correctly and submit.
>
> I have tried the form without tiles and it worked perfectly.
>
> Is this a know error in Struts 1.1b2 and is there a way around
> this problem?
>
> Thanks in advance
> Roland Carlsson
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>