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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:58:09+00:00 2026-05-15T19:58:09+00:00

How can I in JSF 2.0 invoke direct methods or methods with arguments /

  • 0

How can I in JSF 2.0 invoke direct methods or methods with arguments / variables / parameters in EL?

For example, getting the list size in EL:

<h:outputText value="#{bean.list.size()}" />

Or invoking an action method with arguments:

<h:commandButton value="edit" action="#{bean.edit(item)}" />

This does not seem to work in my environment. It doesn’t seem to like parentheses.

javax.el.ELException: Error Parsing: #{bean.list.size()}
com.sun.el.parser.ParseException: Encountered “(“

  • 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-15T19:58:10+00:00Added an answer on May 15, 2026 at 7:58 pm

    In standard EL prior to EL 2.2 from Java EE 6 you cannot directly invoke methods like
    #{bean.method()} nor invoke methods with arguments like #{bean.method(arg1, arg2).

    If upgrading to a EL 2.2 / Java EE 6 compliant container (Tomcat 7, Glassfish 3, JBoss AS 6, etc) is not an option and you’re currently using EL 2.1 / Java EE 5 (Tomcat 6, Glassfish 2, JBoss AS 4, etc), then your best bet is to install JBoss EL. JBoss EL is an EL 2.1 compliant implementation which supports the same features as EL 2.2. Installing JBoss EL is a matter of putting the jboss-el.jar in /WEB-INF/lib and adding the following to the web.xml, assuming that you’re using Mojarra:

    <context-param>     
        <param-name>com.sun.faces.expressionFactory</param-name>
        <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>   
    </context-param>
    

    Or, when you’re using MyFaces:

    <context-param>     
        <param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name>
        <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>   
    </context-param>
    

    An alternative for your particular case is to use JSTL’s fn:length:

    <h:outputText value="#{fn:length(bean.list)}" />
    

    Another alternative is to add a getter to the bean which returns List#size() or in some specific cases a custom EL function.


    Please note thus that invoking methods with arguments in EL is not a JSF 2.0 specific feature. It’s an EL 2.2 specific feature. EL 2.2 is part of Java EE 6, which JSF 2.0 is also part of. So it look like a JSF 2.0 specific feature, but it isn’t. JSF 2.0 is backwards compatible with Servlet 2.5 / EL 2.1 which lacks this feature. On the other hand, JSF 1.x is forwards compatible with Servlet 3.0 / EL 2.2, so it would also be possible to use this feature in JSF 1.x then, also using JBoss EL on Servlet 2.5 / EL 2.1.

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

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 500k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is not pretty but it works: rm -R $(ls… May 16, 2026 at 12:45 pm
  • Editorial Team
    Editorial Team added an answer Yes. Override the base1 and base2 methods in Derived to… May 16, 2026 at 12:45 pm
  • Editorial Team
    Editorial Team added an answer No, you can't. Unfortunately, UIEvent doesn't expose any public way… May 16, 2026 at 12:45 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Can any one list out the tips to tune JSF WebApp @ its best.
in my JSF application i need to update ui component during invoke application phase.
In my JSF/Facelets application, I want to dynamically generate a breadcrumb trail from a
I've a JSF app deploying from Eclipse Ganymede through Tomcat 6. The latter suggests
I'll try to explain my problem. I use the JSF 1.2 implementation of IBM
I have a problem integrating JQuery with JSF. I use Spin. and I have
Is there a way I can tell my application to let every single page
I have one method in my managed bean which returns javascript as a string.
Enviroment: JSF 2.0, RichFaces 3.3.3, Facelets 1.1.15B1, Spring Framework 3.x, WebFlow 2.1, MyBatis 3.0.1,
hope you can help me with this: I'm working with j_security_check and have this

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.