• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

jsf render < and > to &lt; and &gt;

 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using JSF 2 to dynamically generate some
    and
  • tags, and use the tool, 'Smooth Navigational Menu' at http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm to display a cascading dropdown menu.

    After the page loads up, the dropdown doesn't behave correctly. When I look at the source code, it is <ul> and <li> instead of
      and
    • which is why the javascript code failed to build up the rich menu.

      Does anyone one know how should I solve this problem? Thanks.
 
Saloon Keeper
Posts: 28654
211
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
Apparently you're getting too clever, since it looks like even in your posted example not all the characters are displaying.

It looks like what you're trying to use is some sort of CSS/JavaScript-based menu system. You might find it easier to work with an actual JSF menu component like one from Apache Tomahawk, RichFaces, or IceFaces.

As far as the actual character rendering goes, normally JSF will escape the "dangerous" ones automatically. However that also means that if you attempt to ram in HTML from a backing bean by brute force, you won't get the HTML, you'll get the escaped version of the HTML. The h:outputText control is one of the few ways to actually inject raw HTML programmatically into a JSF view, since as a general rule, JSF prefers to enforce the separation of Model, View and Controller.
 
reubin haz
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim.

I often use javascript to enforce some change on html, rather that to use some third party framework. I know it's not always the best way to do, but I think it's also not uncommon to have business logic, or control, in javascript in many populate websites.

I looked into richfaces and icefaces. I found a good example for icefaces (http://component-showcase.icefaces.org/component-showcase/showcase.iface). Then I used icefaces-2.0.0-Beta-1 to integrated with my jsf 2 code.

But the page does not show up any html for icefaces tags, when I use firebug to look at them, the code are there, but its in grey color, looks like been hidden, and I found some code being inserted:



It looks like been added by icefaces. But why the <ice:menuBar>, <ice:menuItem> tags are not displayed at all?
reply
    Bookmark Topic Watch Topic
  • New Topic