replace the line in your action
    Group g=(Group)intake.get("Enterfields",IntakeTool.DEFAULT_KEY);
with
    Group g=(Group)intake.get("Enterfields",IntakeTool.DEFAULT_KEY,
false);

and see if the line following it throws an NPE.

Also

For the value attribute in

> >        <input name="$enterfields.Emailadr.Key" value="" type="text"
> > size="40" >

use $enterfields.Emailadr

Then make sure the response is the same form that submitted and see if
what you typed in the email field is repeated.

Finally put a debugging statement in your form or action to show the
request parameters. Send the results for the second form or the action.

In the template you can just put a $data.Parameters to get a printout of
all the request data.

john mcnally


Britta Ladwig-Attinger wrote:
> 
> I did try other rules:
> 1. <rule name="mask" value=".+@.+\..+">Please enter a valid email
> address</rule>
> 2. rule ... minLength=1 ....
> 
> Same result!!
> 
> It is possible that the required rule had a bug in tdk2.1 build.  Is
> that what you are using?  Try adding other rules to see if they work.
> 
> <rule name="mask" value=".+@.+\..+">Please enter a valid email
> address</rule>
> 
> john mcnally
> 
> Britta Ladwig-Attinger wrote:
> >
> > TDK version: 2.1
> >
> > Intake problem: method 'isAllValid()' always returns true
> >
> > I had a very deep look in the Scarab code but can't see any difference to
> my
> > code.
> >
> > If someone could please give me an idea of what I do wrong,
> > I would depply appreciate!!!
> >
> > Code:
> >
> > 1. in Turbine Resources:
> >
> services.IntakeService.classname=org.apache.turbine.services.intake.TurbineI
> > ntakeService
> > tool.request.intake=org.apache.turbine.services.intake.IntakeTool
> > # Intake Service
> > services.IntakeService.xml.path=WEB-INF/conf/intake.xml
> >
> > 2. in web-inf/conf/intake.xml
> >
> > <input-data basePackage="com.mmi.site.">
> >         <group name="Enterfields" key="enterfields">
> >                 <field name="Emailadr" key="emailadr" type="String">
> >                         <rule name="required" value="true">Please enter an
> > email address
> >                         </rule>
> >                 </field>
> >         </group>
> >  </input-data>
> >
> > 3. the template where the field is used in:
> >
> > <form method="post"
> >
> action="$link.setPage("ticket,ConfirmTicketOrder.vm").setAction("ticket.Orde
> > rTicketAction")">
> > ....
> > #set ( $enterfields = $intake.Enterfields.Default )
> >
> > #if ( !$enterfields.Emailadr.isValid() )
> > $enterfields.Emailadr.Message<br>
> > #end
> >       <td>
> >        <input name="$enterfields.Emailadr.Key" value="" type="text"
> > size="40" >
> >   </td>
> > ...
> > $intake.declareGroups()
> > </form>
> >
> > 4. The java code in form's action OrderTicketAction.java:
> >
> >  public class OrderTicketAction extends VelocityAction
> > ....
> > public void doPerform(RunData data, Context context)
> >         throws Exception
> >  {
> >          IntakeTool intake = (IntakeTool)context.get("intake");
> >         if ( intake.isAllValid())
> >         {
> >             Group
> g=(Group)intake.get("Enterfields",IntakeTool.DEFAULT_KEY);
> >             String s=g.get("Emailadr").toString();
> >         }
> >
> >         else
> >         {
> >          setTemplate(data, "TicketOrder.vm");
> >         }
> > ....
> >
> > in this code inatke.isAllValid() always returns TRUE,
> > even if nothing had been entered in the email field.
> >
> > Thanks,
> >
> > Britta
> >
> >   ------------------------------------------------------------------------
> >                   Name: winmail.dat
> >    winmail.dat    Type: application/ms-tnef
> >               Encoding: base64
> >
> >   ------------------------------------------------------------------------
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to