vikrant S wrote:
Initially I did not check for null textfield and I was able to validate the
username and password directly from database.but When I applied validate
method in my action class It began to validate for null fields but not for
stored username and password. I am pasting my code..
Are you sure the validate() method you've written is doing what you
think it is? If there are no field errors after the validate() method,
the execute() action will run--that's just how it works.
ResultSet results =sql.executeQuery("select * from my_table where usr =
"+" '"+userid+"'"+" and pass = "+"'"+pwd+"'");
SQL injection: be wary here.
if (results != null)
Is this the appropriate check, or should you be checking for a length?
Have you turned up the logging levels to get a handle on what's going on
behind the scenes?
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org