Reputation: 35
I have got a bean that have a method that checks if a user is logged in and returns a String containing HTML code. Is there any way that I can render this String on the webpage after it has been returned?
Upvotes: 0
Views: 507
Reputation: 19776
Of course. In your managed bean:
public String checkLogin() {
return "<h2><b>User was not logged in.</b></h2>";
}
And in your xhtml file:
<h:outputText escape="false" value="#{bean.checkLogin()}" />
Upvotes: 2