You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by wu qihua <wq...@hotmail.com> on 2002/08/28 05:21:52 UTC

form validate: when using System.out.println() ,there is information print

   I want to get the information about a field the form bean,and let it 
print the information in the funtion of validate.but actually it did not 
work according to my intention,it DO print nothing.every time I refresh the 
browse ,and click the submit button.It just print this information

  2002-8-28 11:11:10 org.apache.struts.action.RequestProcessor process
   information: Processing a 'POST' for path '/logon'


public ActionErrors validate( ...)
  {
      System.out.println(book);
      if (book=="java"){
	System.out.println(book);
        	throw new UnsupportedOperationException("Easy Struts : not ....");
	  }
       else
           return null;
	}



_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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


Re: form validate: when using System.out.println() ,there is information print

Posted by John Raley <jb...@mindspring.com>.
Use book.equals("java") (or better "java".equals(book) in case book is 
null).

== only determines whether two references point to the same object.

wu qihua wrote:

>   I want to get the information about a field the form bean,and let it 
> print the information in the funtion of validate.but actually it did 
> not work according to my intention,it DO print nothing.every time I 
> refresh the browse ,and click the submit button.It just print this 
> information
>
>  2002-8-28 11:11:10 org.apache.struts.action.RequestProcessor process
>   information: Processing a 'POST' for path '/logon'
>
>
> public ActionErrors validate( ...)
>  {
>      System.out.println(book);
>      if (book=="java"){
>     System.out.println(book);
>            throw new UnsupportedOperationException("Easy Struts : not 
> ....");
>       }
>       else
>           return null;
>     }
>
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>


-- 
Check it out: Map -> JavaBean
http://dynclass.sourceforge.net/




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