• 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

Render problem

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>JSP Page</title>
</head>
<body>
<div>
<h:outputLabel for="name" value="Enter your name:"/>
<h:inputText id="name" value="#{NameBean.name}"/>
<h:commandButton value="Submit"/>
</div>
<div>
<h:outputText value="Hello, #{NameBean.name}" rendered="#{NameBean.name!=null&& NameBean.name!=' '}"/>
</div>
</body>
</html>
</f:view>

here render part didn't work. my expected result was ------ (Hello, ******)------ here ***** means the input string.
And NameBean is in session scope... Please help me out....
 
Saloon Keeper
Posts: 27763
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
Welcome to the JavaRanch, Anne!

There's a "code" button on the message editor. If you use that, it will allow you to display your code and data in a more readable format.

EL is not the same thing as Java code, and I don't think it understands "null" in your expression.

However it does have an easier way:

 
reply
    Bookmark Topic Watch Topic
  • New Topic