File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes jsf render < and > to < and > Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "jsf render < and > to &lt; and &gt;" Watch "jsf render < and > to &lt; and &gt;" New topic
Author

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

reubin haz
Ranch Hand

Joined: May 12, 2005
Posts: 287
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.


SCJA, SCJP5.0, SCBCD, SCWCD
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

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 hutputText 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.


Customer surveys are for companies who didn't pay proper attention to begin with.
reubin haz
Ranch Hand

Joined: May 12, 2005
Posts: 287
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsf render < and > to &lt; and &gt;
 
Similar Threads
Embedding Lists in XHTML
Question on how to implement multi level menu (navigation bar) in html/css
JSF conditional HTML
Problem with struts-menu for second level submenu
Not achieving space between div blocks containing lists