• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

print record in jsf

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want print eg success on a webpage in jsf. i don't want to use

return="success.xhtml"

i tried using

System.out.println("success");

but it displays nothing on a web page
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

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).
 
muntago Richard
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it got printed within the tomcat in eclipse. it now working

thank you.

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




but it is not working




 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if(!empname.equals("Mutago")){

WP
 
Tim Holloway
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, I will repeat:

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic