cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gustavo Mejia <gme...@infotec.com.mx>
Subject Re:How can I make a validation !
Date Tue, 19 Jun 2001 21:52:17 GMT
Hi everyone,

I got it, the problem was when I tried to compare with null, I don't
know why Cocoon doesn't recongnize the condition if (Test !=null), could
this be a bug ?, in other to make it works I change to:

<xsp:logic>
String Test;
 Test = request.getParameter("EMP_DEP");
      if (Test.length() !=0)
  {
       my_code
  }
</xsp:logic>


See you.

Gustavo


Gustavo Mejia wrote:

> Hi Pal,
>
> Thanks, I also tried this, with no good results, still passing to the
> code, that I need to skip.
>
> :(
>
> any other Idea is very wellcome !!
>
> Thanks !!
>
>
>
> Pal Wester wrote:
>
>> Why not just use request.getParameter("EMP_DEP") when ur in a
>> javablock...<xsp:logic>
>>   if ( request.getParameter("EMP_DEP")  != null )
>>   {
>>         <esql:connection>
>>             <esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
>>             <esql:dburl>JDBC:ODBC:SQL</esql:dburl>
>>             <esql:username>user</esql:username>
>>             <esql:password>password</esql:password>
>>             <esql:execute-query>
>>               <esql:query>insert into Departamento values(
>>                    <esql:parameter
>> type="string"><request:get-parameter
>> name="EMP_CLVE"/></esql:parameter>,
>>                    <esql:parameter
>> type="string"><request:get-parameter
>> name="EMP_DEP"/></esql:parameter>
>>                    )
>>               </esql:query>
>>
>>             </esql:execute-query>
>>        </esql:connection>
>>   }
>> </xsp:logic>
>> mvh: Pål Wester
>> høgskoleingenør/programmerer
>> [Image]
>> never.no as, stortingsgt 30, 0161 Oslo
>> direkte: 22 01 66 34, 906 900 62
>> tlf: 22 01 66 34, fax: 22 01 66 21
>> http://never.no - icq:103476059
>>
>>
>>
>>      -----Opprinnelig melding-----
>>      Fra: Gustavo Mejia [mailto:gmejia@infotec.com.mx]
>>      Sendt: 19. juni 2001 01:04
>>      Til: cocoon-users@xml.apache.org
>>      Emne: Re: How can I make a validation !
>>      Viktighet: Høy
>>
>>      > Hi everyone !!
>>      >
>>      > Now my problem is: I know that my variable EMP_DEP is
>>      > null, and I don't know why is passing to the connection
>>      > section.and if I add one line with: System.out.println("
>>      > enter " + <request:get-parameter name="EMP_DEP"/>);before
>>      > star the connection, just appear "enter".
>>
>>      Do you know why ?? here my code !
>>
>>      >
>>      > <xsp:logic>
>>      >   if (<request:get-parameter name="EMP_DEP"/>  != null)
>>      >   {
>>      >         <esql:connection>
>>      >
>>      > <esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
>>      >             <esql:dburl>JDBC:ODBC:SQL</esql:dburl>
>>      >             <esql:username>user</esql:username>
>>      >             <esql:password>password</esql:password>
>>      >             <esql:execute-query>
>>      >               <esql:query>insert into Departamento
>>      > values(
>>      >                    <esql:parameter
>>      > type="string"><request:get-parameter
>>      > name="EMP_CLVE"/></esql:parameter>,
>>      >                    <esql:parameter
>>      > type="string"><request:get-parameter
>>      > name="EMP_DEP"/></esql:parameter>
>>      >                    )
>>      >               </esql:query>
>>      >
>>      >             </esql:execute-query>
>>      >        </esql:connection>
>>      >   }
>>      > </xsp:logic>
>>      >
>>      > But it doesn't work, I got the message :
>>      >
>>      > java.lang.Exception: XSP Java Compiler: Compilation
>>      > failed for _nuevo.java
>>      > 433: ')' expected.
>>      >
>>      >     xspParentNode = xspCurrentNode;
>>      >
>>      > Could you help me ? do you know what I am doing wrong ?
>>      >
>>      > Thanks in advance !!
>>      >
>>      > Gustavo Mejia
>>      > INFOTEC
>>      >
>>

Mime
View raw message