I think it's not a bug. That means that you had empty param in your URL:
EMP_DEP=
In this case you'll get an empty string and not a null value.
So, the best way to check is to use both:
if (test != null && test.length() != 0) or
if (test != null && !"".equals(test))
I'm not sure, that it's absolutely correct, cause I didn't test it myself.
Regards,
Konstantin Piroumian
----- Original Message -----
From: Gustavo Mejia
To: [EMAIL PROTECTED]
Sent: Wednesday, June 20, 2001 1:52 AM
Subject: Re:How can I make a validation !
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
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
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>