Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Render problem  RSS feed

 
anne shrestha
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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>
<hutputLabel for="name" value="Enter your name:"/>
<h:inputText id="name" value="#{NameBean.name}"/>
<h:commandButton value="Submit"/>
</div>
<div>
<hutputText 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....
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!