Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 255659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:56:57+00:00 2026-05-11T21:56:57+00:00

I hava an unordered List navigation and i wanted to transform this to JSF

  • 0

I hava an unordered List navigation and i wanted to transform this to JSF code.
Actually , there is no JSF tag ..

Here is the raw-HTML Navigation :

<ul id="navbar">
<li id="articles"><a href="Link1">Articles</a></li>
<li id="topics"><a href="Link2" title="Topics">Topics</a></li>
....
</ul>

..so what should i do ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:56:57+00:00Added an answer on May 11, 2026 at 9:56 pm

    One way to do ad-hoc templating is to use Facelets instead of JSPs. Since these have become part of JSF 2.0 (due in JEE6), I think it is a good time to consider them.

    For example, for the beans:

    public class LiBean implements Serializable {
    
      private static final long serialVersionUID = 1L;
    
      private String href;
      private String title;
    
      public String getHref() { return href; }
    
      public void setHref(String href) { this.href = href; }
    
      public String getTitle() { return title; }
    
      public void setTitle(String title) { this.title = title; }
    
    }
    

    …and:

    public class UlBean implements Serializable {
    
      private static final long serialVersionUID = 1L;
    
      private final List<LiBean> listItems = new ArrayList<LiBean>();
    
      public UlBean() {
        String[] links = { "http://www.sun.com", "Sun",
            "http://www.oracle.com", "Oracle",
            "http://www.ibm.com", "IBM",
            "http://stackoverflow.com",
            "<stackoverflow.com> & encoded output" };
        for (int i = 0; i < links.length; i++) {
          LiBean item = new LiBean();
          item.setHref(links[i]);
          item.setTitle(links[++i]);
          listItems.add(item);
        }
      }
    
      public List<LiBean> getListItems() {
        return listItems;
      }
    
    }
    

    …defined in session scope:

      <managed-bean>
        <managed-bean-name>ulBean</managed-bean-name>
        <managed-bean-class>beans.UlBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>
    

    …can be used in this Facelet page:

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>repeat</title>
    </head>
    <body>
    <ul>
      <ui:repeat value="#{ulBean.listItems}" var="item">
        <li><a href="#{item.href}"><h:outputText
          value="#{item.title}" /></a></li>
      </ui:repeat>
    </ul>
    </body>
    </html>
    

    …to produce this output:

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>repeat</title>
    </head>
    <body>
    <ul>
        <li><a href="http://www.sun.com">Sun</a></li>
        <li><a href="http://www.oracle.com">Oracle</a></li>
        <li><a href="http://www.ibm.com">IBM</a></li>
        <li><a href="http://stackoverflow.com">&lt;stackoverflow.com&gt; &amp; encoded output</a></li>
    </ul>
    </body>
    </html>
    

    If you are sticking with JSPs, there isn’t anything in the core implementation that will let you do this (the only repeating control is the dataTable). You may find something in one of the 3rd party component libraries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the thing. I hava a simple snippet in PHP like this regarding a
I hava a problem with this mssql_query in PHP : $query = 'SELECT Ville
I hava a CSV file that I want to treat as source code. Essentially
I hava a xml doc (and complex element) that is similar to this example:
I hava a url such as search.do?offset=20 offset sometimes is in the url sometimes
I hava a jQuery UI datepicker which I intend to use with a textbox
I hava a Java program that needs to monitor a directory tree for changes.
I hava very large table with 1373228 rows. I need to copy the result
I hava a time string,the format is HHMM, I need to get the decimal
I hava a application that works with pictures(just a full screen app with 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.