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 7528397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:22:09+00:00 2026-05-30T04:22:09+00:00

I know this is not supported in UIData and I understand why, but this

  • 0

I know this is not supported in UIData and I understand why, but this should be a common issue for people using JPA and JSF since Sets are the superior collection when mapping M2M O2M relationships.

I know I need to create some structure to convert my property to a list when it’s needed but after extensively googling this problem all I can find is reasons why it doesn’t work, and only slight hints of a solution.

I believe the answer is to create an ELResolver to handle this but the structure of them and how they work is baffling to me and I don’t see why I would need to be the one writing this when it’s a common issue, Surely someone has written an ELResolver to do this?

I have found this article on the subject but I can’t replicate it because the newer JSF doesn’t seem to allow it:

http://techblog.bozho.net/?p=28&cpage=1#comment-13700

And this:

http://www.jroller.com/mert/entry/settolistpropresolver_for_jsf_el

Which is full of deprecated code because it’s pre ELResolver. But I just can’t find how to implement an ELResolver to do it. Can someone point me to some code that works or at least something similar that will help me fathom out how to use an ELResolver?

  • 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-30T04:22:10+00:00Added an answer on May 30, 2026 at 4:22 am

    Something easier, support for Set (actually, the entire Collection interface) in DataModel is available in JSF 2.2. It’s currently already available as snapshot so that you can just start developing. It will be released around Q2.


    Update: as per the comments, it didn’t seem to quite work seamlessly together with Spring Web Flow. It turns out that it’s not JSF 2.2 compatible (and initially also not JSF 2.1 compatible). Well, a custom ELResolver should be your best bet.

    Easiest is to let it extend ListELResolver as follows:

    public class SetToListELResolver extends ListELResolver {
    
        public static final String KEY_PROPERTY = "setToList";
    
        @Override
        public Object getValue(ELContext context, Object base, Object property) {
            if (base instanceof Set<?> && KEY_PROPERTY.equals(property)) {
                context.setPropertyResolved(true);
                return new ArrayList<Object>((Set<?>) base);
            }
    
            return super.getValue(context, base, property);
        }
    
    }
    

    If you register it as follows in faces-config.xml

    <application>
        <el-resolver>com.example.SetToListELResolver</el-resolver>
    </application>
    

    then you’ll be able to use it in the syntax of #{bean.set.setToList} wherein the .setToList is a special property which will trigger the conversion:

    <h:dataTable value="#{bean.set.setToList}" ...>
    

    It will effectively end up in a fictive

    <h:dataTable value="#{new ArrayList(bean.set)}" ...>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this a is a common issue, but everything I can find in
I know this is not programming directly, but it's regarding a development workstation I'm
I know this is not a real programming question. But, it relates to programming
I know this is not programming related, but I have a scenario. Each video
Hey. I know this is not a 'refactor my code' site but I made
I know this might sounds not reasonable, and might be a bad design. But
I know this probably really simple but Im not sure what im doing wrong...
I know this sort of code is not best practice, but nevertheless in certain
As far I know this is not supported for asp.net projects. It's quite handy
I know this is similar to this question , but I'm using SQL Server

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.