I am seeing several questions asking how to pass parameters to JSF methods. With EL2.2 and servlet 3.0, it enables user to pass parameters into a method call. One example: How to pass an argument to method from rendered h:outputText? The question is: In JSF 2.x, each tag attribute is supposed to take either ValueExpression or MethodExpression. In the linked example, "rendered" is supposed to only take ValueExpression. However I do see it still works with MethodExpression if we put () to make it clear it is a method call instead of a property. Is this something the JSF 2.x spec just messed up or am I missing something?
How come JSF 2.x with EL 2.2 allows MethodExpression in place for ValueExpression?
1.1k Views Asked by Baimai Wu At
1
There are 1 best solutions below
Related Questions in JSF-2
- JSF 2 Primefaces : On Ajax reponse I can see extra updates sent by server <update id="javax.faces.Resource"> and which cause my action skipped
- Understanding HTTP sessions in JSF as session attributres are going null unexpectedly while working actively on the application
- How to clear data from datatable using primefaces and java
- CDI Interceptor fires BEFORE HttpAuthenticationMechanism validates request
- JSF user lockout after X failed login attempts
- JSF ExceptionHandler - Response already committed in some cases
- Why am I getting Class NotFound Exception using data table with jsf
- Java Beans - how to ignore boolean isXXXXMethod in favor of BOOLEAN getXXXXMethod in JSF page?
- Input element created with h:inputText is not editable
- NullPointerException during initFaces of a MyFaces 2.0 application while migrating from WLS to Tomcat
- Primefaces 10 HTML styling in DataTable emptyMessage
- jsf2, primefaces 11, Component ID j_idt20 has already been found in the view
- Hide rows of datatable based on condition in JSF2
- How to generate and preview a presigned url of a file in jsf?
- commandLink action parameter not displayed in JSF2
Related Questions in EL
- Why ${message} appear as it is in View and not the real message passed in Spring MVC controller
- jakarta.el.PropertyNotWritableException: Illegal Syntax for Set Operation for the PrimeFaces <p:selectOneMenu /> component
- PrimeFaces menuItem #{component}
- The server does not display the answer when calculating
- How to define variable with namespace in EL processor?
- EL expressions are not evaluated in JSP
- I can invoke static methods in EL, is this as per the spec?
- Property [login] not found on type [com.app.dev.controller.LoginController]
- Access JavaBean object and pass argument to JSP using EL
- How to remove previous request parameter from URL query string
- How to evaluate a scriptlet variable in EL
- How to pass item of h:dataTable with ResultSetDataModel to action method?
- JSP question about accessing keys in an object?
- Upgrading Apache Tomcat from 7.0.50 JSTL stops working
- JSF EL overload method inheritance
Related Questions in RENDERED-ATTRIBUTE
- JSF - How to throw an exception when submit a button with condition rendered = false
- What happen if you submit a button with condition rendered = false
- Hide specific <h:selectOneRadio> items
- XPages CSJS gets executed while SSJS does not
- Displaying JSF components for multiple selecitems using rendered
- Textbox ID of Items not working properly
- is it possible to include the value of the 'id' attribute in the 'rendered' condition of a JSF component?
- PrimeFaces 5.2: How to render Element that dependent on different contexts?
- JSF is not showing component even though the attribute "rendered" evaluates to true
- rendered attribute not evaluated in include
- Render link when not null
- <div jsf:rendered> is not interpreted as passthrough element
- <a jsf:rendered="#{...}"> is not interpreted as passthrough element
- Rendering elements in MyFaces 1.1.1
- Rendered attribute for PrimeFaces datatable not working
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Using the new EL 2.2 invoking-methods-with-arguments syntax in a value expression doesn't automagically make it a method expression or something. It's still a value expression. A value expression uses the returned value of the given EL expression as a value. A method expression invokes the given EL expression upon an action event associated with the component.
Whether the EL expression at its own invokes a property getter method or an arbitrary method with arguments really doesn't matter as to how the EL expression at the whole is treated.