Don't use System.out.println in anyJ2EE webapp, JSF or not. You don't know where it's going to go. For general logging, use a real logger.
Normally, I do navigate to a "success" page myself, although in some cases I may simply display the message on the current page. I can do that by either making the page reference a property that will be set with the message or by using the JSF internal message component. Either way, I'd return null to indicate that the existing page would be re-displayed (with the updated message).
An IDE is no substitute for an Intelligent Developer.
Joined: Nov 13, 2010
it got printed within the tomcat in eclipse. it now working
my final question
This prints ok if empnane is equal to Mutago. My question now is
How do i print error if empname is not equal to Mutago. I tried this
Don't use System.out.println in any J2EE webapp, JSF or not. You don't know where it's going to go. For general logging, use a real logger.
Just because YOUR (obsolete) copy of Tomcat "works" doesn't mean that what you are doing is safe or reliable. And in the specific case of Tomcat under Windows, the stdout/stderr streams are known offenders when it comes to having output vanish to who-knows-where without a trace.