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

  • SEARCH
  • Home
  • 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 7958871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:29:11+00:00 2026-06-04T04:29:11+00:00

how can I pass a List to a JSF-Component in EL without a backingbean?

  • 0

how can I pass a List to a JSF-Component in EL without a backingbean? Or in other words how can I declare and initialize a List/Array in JSF without a bean?

Example:

caller.xhtml

/* Call a JSF-Component */
<mycomp:displayList value="HERE I WANT TO PASS A LIST WITHOUT A BACKINGBEAN"/>

displayList.xhtml

/* MY Component */
<composite:interface>
     <composite:attribute name="value" type="java.util.list" />
</composite:interface>

Is there any possibility to pass a List/Collection which is not declared in a Bean to a JSF component?

  • 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-06-04T04:29:12+00:00Added an answer on June 4, 2026 at 4:29 am

    Although there is no list literal in EL, you can declare a list without requiring a bean to contain it by declaring one in faces-config.xml:

    <managed-bean>
        <managed-bean-name>someList</managed-bean-name>
        <managed-bean-class>java.util.ArrayList</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <list-entries>
            <value>One</value>
            <value>Two</value>
            <value>Three</value>
        </list-entries>
    </managed-bean>
    

    You can also use a utility type to build a list:

    import java.util.*; import javax.faces.bean.*;
    
    @ManagedBean @NoneScoped
    public class Lister<T> extends AbstractList<T> {
      private List<T> list = new ArrayList<T>();
    
      public Lister plus(T t) {
        list.add(t);
        return this;
      }
    
      @Override public T get(int index) {
        return list.get(index);
      }
    
      @Override public int size() {
        return list.size();
      }
    
      @Override public String toString() {
        return list.toString();
      }
    }
    

    This can be used with an expression like #{lister.plus('one').plus('two').plus('three')}

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

Sidebar

Related Questions

I know you can pass in an array list of String via intent, but
How i can pass Array List from one Activity to another my array list
In php there is a list of all the parameters you can pass to
Is there any way that I can pass arguments in selector? example: I have
I want to pass a list array from the View to the controller on
How can I pass a list as a parameter to a function adding elements
I would like to know how I can pass a list with values in
I'm using Django PayPal . PayPal has a list of options you can pass
Simple question: How can I pass an arbitrary list of args to a python
I have a List object. How can I pass these list values to separate

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.