el 1 « Development « JSF Q&A

1. JSF, how to use EL in onclick    stackoverflow.com

I want to create links using database columns. I have a backing bean where I 'm connecting to the database. There is no problem with the connection and also no problem ...

2. JSF 1.2 - cannot access javax.el.ELContext    stackoverflow.com

I got this error:

cannot access javax.el.ELContext
class file for javax.el.ELContext not found
I'm using Tomcat 6.0.20 and Mojarra JSF 1.2_13-b01-FCS. What class am I missing? Please help.

3. What is the difference between #{expr} and ${expr} in jsf? Are there any cases when we should prefer ${expr}?    stackoverflow.com

I've read some time ago about the difference in 'Core JSF' but now I can't find that place. Nevertheless I don't remember that there was a word about cases when we ...

4. Using JBoss EL with Websphere    stackoverflow.com

I'm doing a project which is going to run on Websphere. I'm using JSF/Facelets/Richfaces for this project. I want to use the JBoss EL implementation as it allows calling methods with parameters from ...

5. Regarding JSF Expression Language    stackoverflow.com

I noticed this behaviour of JSF EL. 1.

<h:panelGroup rendered="#{!admissionBean.requestStatus=='PR'}">
..some buttons without rendered attribute
<h:inputText size="6" value="#{dimension.newWeight}" disabled="#{admissionBean.requestStatus=='PR'}"></h:inputText>
1 is not rendered. 2. text box is not disabled. How can both happen together? textbox not disabled means ...

6. null check in jsf expression language    stackoverflow.com

Please see this Expression Language

styleClass="#{obj.validationErrorMap eq null ? ' ' :  
Even if the map is null, highlight_row style is getting applied. So I changed to ...

7. JSF - how to dynamically display values from messages.properties    stackoverflow.com

I have a DataModel which has plan names and some other attributes. I have different plans - gold , silver etc. But I dont want to display Gold or Silver as it is. ...

8. How to call Javascript function in JSF EL conditionally?    stackoverflow.com

I have to call Javascript funtion based on the bean value. i use the following code

I need to send some parameters in Tip() like this
Tip('<img src="pics/image.jpg" width="60">')
Error ...

9. JSF2 ResourceBundleLoader override?    stackoverflow.com

I need to have resource messages that contain EL expressions be resolved when loaded from a ResourceBundle. Basically I have a number of properties files containing the text. Some of the ...

10. JSF Deferred EL conditional syntax problem    stackoverflow.com

I can't find any resources which can answer why I'm getting an error with this:

oncomplete="#{MyBacking.oError ? #{rich:component('oErrorPanel')}.show() : return false;}"
in a richfaces a4j:commandButton. oError is referring to a method in ...

11. How to invoke JSF action on an anonymous class? EL cannot access it    stackoverflow.com

I want to have a generic menu in my jsf (myfaces 1.2) application.

  <h:dataTable id="dt1" value="#{portal.actionList}" var="item">
    <f:facet name="header">
        <h:outputText ...

12. nested el in jsf    stackoverflow.com

I am having a problem with nested EL for <t:inputText> required Attribute. I am using tomahawk implementation. I have a dataTable with 2 columns of inputText. I have forceId=true for both the ...

13. Expression language implicit objects    stackoverflow.com

How can the JSF implicit objects be access via expression language? For example, if I wanted to determine what roles the current principal is associated with, how could I do this?

14. JSF2 EL: Access ResourceBundle keys which contain dots from within Javascript?    stackoverflow.com

My JSF2 application is fully internationalized, using a ResourceBundle. Now i have a lot of Javascript-code, which does some alerts and stuff. There i would like to access my ResourceBundle. I ...

15. Performance of resolving EL Value Expressions    stackoverflow.com

I have a JSF2 application that renders a large table with complex content. Unfortunately, each request takes up to 6 seconds to process. Using simple debug output inside a phase listener, ...

16. Why is a dynamic created JSF EL value expression not resolved?    stackoverflow.com

I got a simple setup (and a big issue): a JSP page with en empty panel grid item container and a binding to a bean.

<h:panelGrid binding="#{ bean.container }" id="container" />
When the ...

17. What does com.sun.el package contain?    stackoverflow.com

Is this just an API defined by Java, to be implemented by (say) servers, or the JRE includes the implementation too? Thing is that I was trying to concatenate two strings using ...

18. JSF 2 : can EL do something like this?    stackoverflow.com

This works :

<h:outputText value="Active Locale : " /> 
But how can i achieve something like this with EL ?
<h:outputText value="Active Locale Decimal Separator : " /> 
#{new DecimalFormat(view.locale).decimalFormatSymbols.groupingSeparator}

19. jsf Invoking Arbitrary Methods via EL    stackoverflow.com

I am starter on JSF and have trouble with invokation of arbitrary methods via EL.
According to what I read version 2.1 of the Unified Expression Language, included in Java EE 6, ...

20. JSF 2 : EL ternary operator question    stackoverflow.com


21. Available operators in JSF 2.0 ValueExpression    stackoverflow.com

I have been using expressions like this in JSF 1.2: rendered="#{foo.bar!=null && !foo.isBar}". However in JSF 2.0 I've found this doesn't work, and rendered="#{foo.bar!=null and !foo.isBar}" comes out to be the ...

22. JSF Compound EL expression    stackoverflow.com

I am trying to validate a inputText box based on the selection of a CheckBox as shown below. < <h:inputText required="#{param[facesContext.externalContext.response.namespace'form:checkBoxId']}"> >. The issue is as you see, the component ...

23. Cufon font isn't applied for link generated with JSF EL expression when use message bundling    stackoverflow.com

I'm trying to use Cufon js lib. to display specific font on web page.
jQuery is used also.

<script language="javascript" src="resources/js/cufon-yui.js"/>
<script language="javascript" src="resources/js/Salaryman_400.font.js"/>
<script type="text/javascript">
if link text obtained with EL ...

24. JSF expression language (EL) question    stackoverflow.com

I have a menu item that I want to show/hide only if the user has certain roles. I'm using the rendered attribute for this, but I'm stuck on something. This works ...

25. JSF rendered only when value is numeric    stackoverflow.com

<h:inputText rendered="#{bean.myStringVariable [is numeric]}" 
Is it possible to have an expression in the rendered element that says render only if the contents myStringVariable is a ...

26. What's wrong with this JSF EL statement?    stackoverflow.com


<c:if test="#{attr1 && !attr2 && (empty attr3)}">
Error returned
The entity name must immediately follow the '&' in the entity reference.
I simply need to check if attribute 1 is ...

27. jsf itemVale and message bundle question    stackoverflow.com

I have a form with a combo box populated like this:

<f:selectItems value="#{programHandler.validLanguages}" 
itemValue="#{languageConstant}" />
I also have a message bundle defined:
<f:loadBundle basename="MessageResource" var="msg" />
My question is, my problem is the ...

28. jsf commandButton navigation javax.el.MethodNotFoundException    stackoverflow.com

Hi I'm trying to test jsf's navigation rules. My Person bean:

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

public class Person {
    private int id;
    private String name;
    private ...

29. JSF EL: instanceof reserved but not yet implemented?    stackoverflow.com

I've found the instanceof operator in JSF EL, but it throws an exception when used. It's obviously reserved but not implemented? When will it (probably) be available, if not already in ...

30. Short circuit operator for JSF(P) EL    stackoverflow.com

Are there short circuit operators for Expression Language used in JSF, JSP? I mean &&,|| Java analog,when if it's obvious that further evaluation of boolean has no sense, that evaluation is ...

31. JSF and expression language: Bind property only when it exists    stackoverflow.com

what is the best way to bind a datacolumn to a property that might or might not exist in the datasource? This happens for example when you have a class hierarchy where ...

32. How do I resolve type differences when using an EL Resolver with WELD?    stackoverflow.com

I have a generic EL producer that I've written to take advantage of WELD's ability to just 'make it work' when I need it done, and even have the type coercion ...

33. Can I use EL for external CSS files with JSF?    stackoverflow.com

In external style sheets of my current JSF project, there are hard-coded links to external resources like

.someId { background-image:url(/context/resources/images/example.jpg); }
In the JSF xhtml documents, I could use EL expressions like ${request.contextPath} ...

34. JSF 1.2 on JBoss 6 and EL expression not being resolved    stackoverflow.com

I have been hitting my head against the wall with this one for few hours already and I dont have a clue why this is happening... Recently we have began process of ...

35. dynamic ui:include with el-expression?    stackoverflow.com

I'm using JSF 2.0. Is there a way to make this code work?

<ui:repeat value="#{theBean.tabList}" var="tab">
    <h:panelGroup rendered="#{theBean.chose == tab.tabHash}">
        <h:outputText value="TESTING #{tab.tabName} ...

36. JSF rendered question    stackoverflow.com

Is EL-parsing of children to elements with rendered="false" really supposed to be evaluated? This is causing me alot of trouble with null pointer exceptions and similar. Looking at the following example:

<p:tab ...

37. Java Unified Expression Language sub-expressions    stackoverflow.com

I have a datatable which provides objects from a list. Within this data table I would like to use a tag like p:columns(primefaces) which provides strings from a list that represent ...

38. Problem in displaying data from database in JSF    stackoverflow.com

i have a problem when i run a page.jsp :

Exception while calling encodeEnd on component : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /compteListe.jsp][Class: javax.faces.component.html.HtmlDataTable,Id: j_id_jsp_1879226420_1][Class: javax.faces.component.UIColumn,Id: j_id_jsp_1879226420_2][Class: javax.faces.component.html.HtmlOutputText,Id: j_id_jsp_1879226420_4]}
Caused by:
org.apache.jasper.el.JspPropertyNotFoundException - /compteListe.jsp(29,13) '#{l.Identifiant}' ...

39. JSF: Concatenation of property name (EL)    stackoverflow.com

How can I concatenate the name of a property using the EL? This is what I tried:

<ui:repeat value="#{someBean.getParts()}" var="part">  
        <h:inputTextarea value="#{someOtherBean.result}#{part}" />  ...

40. EL expressions are not evaluated    stackoverflow.com

My inputname.jsp file

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> 
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> 

<title>enter your name page</title> 
<h: outputText value="JSF 1.2 Tutorial"/> 
<h:form id="UserEntryForm"> ...

41. ELException when parsing a conditional expression in the style property of h:inputText    stackoverflow.com

I'm having a problem with one of my custom JSF components. My component is called inputTextCustom. In one of the pages that uses this custom component, I have :

<s:inputTextCustom length="400px"/>
And within ...

42. why won't f:selectItems allow me to add another value? JBOSS/JSF    stackoverflow.com

I have the following code:

<ui:repeat var="_shipment"
<h:selectOneMenu value="#{_shipment.shipmentMethodCode.id}">
    <f:selectItems id="selectShipList"
        value="#{consoleContext.shipmentMethods}" />
In the f:selectItems value attribute I want to add #{_shipment.shipmentMethodCode.id} - ...

43. JSF: Deferred EL does not get resolved    stackoverflow.com

I'm having some problems with JSF. It look like deferred evaluations (eg. #{bean.property} do not get resolved. Immediate evaluations (eg. ${bean.property}) seem to work fine. The following JSF page:


44. JSF 2.0 EL code completion doesn't work in NetBeans 7.0 mavenized JavaEE 6.0 Jboss Weld example project    stackoverflow.com

I have imported login example project from Jboss Weld examples into NetBeans IDE 7.0. Application works great on GlassFish 3.1. But the IDE seams to fail. The code completion doesn't work ...

45. weblogic 10.3.4 java.lang.ClassNotFoundException: javax.el.ELContextListener    stackoverflow.com

I have a JSF 1.2 application which I intend to deploy to Weblogic 10.3.4. At local Tomcat environment it works fine. But when I try to deploy it to weblogic I ...

46. How to create a custom EL function?    stackoverflow.com

Im new to JSF 2. My question is related to BalusC's answer to this question jsf2 ajax update parts based on request parameters I tried the kickstart code BalusC ...

47. JSF Problem with using maxInactiveInterval    stackoverflow.com

Folks, I'm finding that with a test value of 1 minute expiry in web.xml the following code redirects to the given url immediately when the page is rendered:

  <meta http-equiv="refresh" ...

48. How to display value of List#size() in JSF EL?    stackoverflow.com

I'd like to know if there's a way to bind the returned value of a method into a JSF component. I'll explain myself better. Let's say I have a class like this:

public class ...

49. Nesting variables in EL    stackoverflow.com

Is it possible to nest variable calls like below in EL using FacesContext or other implicit objects like request, session, etc.? This of course is not working. I get this ...

50. What is the difference between #{...} and ${...} in EL Syntax    stackoverflow.com

My question is straightforward as you can see. What is the difference between #{...} and ${...} in EL Syntax?

51. Getting an EL in a Javascript file, loaded by @ResourceDependency    stackoverflow.com

I'm using @ResourceDependency annotation in a JSF component to add Javascript and CSS files into my JSF page. In my Javascript file, I need to reference another resource file (a .swf file, ...

52. What is the preferred way to specify an empty outcome in an EL-conditional expression?    stackoverflow.com

I often want to declare conditional CSS style-classes for components if a certain condition is met. If the condition is not met, then no style should be added. I usually do ...

53. JSF2: Passing a method in an EL expression    stackoverflow.com

is it possible to pass a method in an EL expression? I have one bean and two views. The second view has a button but which method the button triggers should be ...

54. Avoid seperate function for commandLink action    stackoverflow.com

I would like to use a property of a form element instead of using an additional function to just return a certain value. Current situation XHTML file:

<h:commandLink action="#{menuBean.navigationAction(menuItem)}" ... >
Managed Bean behind it:
public ...

55. JSF converter for f:param    stackoverflow.com

I'm using dynamically created links:

          <h:link outcome="/page" value="#{name}">
            <f:param name="name" value="#{name}"/>

56. Cast with Expression Language    stackoverflow.com

Is it possible to cast using EL? I've got a class Vehicle, and two other classes Car and Bus that extends Vehicle. I'm searching for all Vehicles and there's some data that has ...

57. Type API variable-resolver is deprecated after JSF 1.1. Use el-resolver instead    stackoverflow.com

We recently upgraded from WebSphere Portal v6.1 to v7.0 and in the process we now have JSF 1.2 available. Creating a new Portlet project in Rad 8 creates a faces-config.xml with ...

58. Inner evaluation in EL 2.2    stackoverflow.com

I have some code as follows:

<f:loadBundle basename="messages.application" var="prop" />
<ui:param name="currentUserAttr" value="#{prop['currentUser']}" /> 
// currentUserAttr=currentUserVal
<h1>Welcome #{sessionScope.currentUserAttr.name}</h1> // should be evaludated to sessionScope.currentUserVal.name
I want to get the value of currentUserAttr then when reading ...

59. How do an OR condition in a EL expression?    stackoverflow.com

I would like to make an OR condition in this menu :

<li class="#{facesContext.viewRoot.viewId == ('/company/team.xhtml' or '/company/partnerships.xhtml' ) ? 'active' : '' }"><a class="item" href="company/company.xhtml">Company</a>

60. The representation of if-elseif-else in EL using JSF    stackoverflow.com

The following JSF code contains two separate <c:if></c:if>. Let's look at it.

<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"

61. JSF expression within another expression    stackoverflow.com

I am trying to write a expression with the unified expression language in JSF that states that, if an image is not empty, then use it otherwise use a default one. ...

62. How to display backslash \ literally between two EL expressions without escaping the 2nd expression?    stackoverflow.com

I have a value attribute:

value="#{mgdBean.directory}\\ #{mgdBean.file}"
I need to trim the white space between directory and file name so that the value appears as:
I cannot remove the white space ...

63. EL in views and outcomes?    coderanch.com

64. JSF EL reference    coderanch.com

65. EL with List of Objects    coderanch.com

I'm using Hibernate to insert/select data from a database. I have a JavaBean class 'Product' that has the getters/setters that Hibernate uses to insert and get data with. My problem is, when I get the data back from Hibernate, I create a list to store the records in, then pass that list back to the JSP as an attribute. I can ...

67. EL fails to work in data table    coderanch.com

68. EL nested usage    coderanch.com

I'll let you in on a secret. All this stuff is handled by the Apache beanutils, which is a general-purpose library that allows you to do an extended set of the kinds of functions that Java's introspection mechanism supports. It also supports accessing data via expressions such as the ones you've listed. You can find details about beanutils at http://jakarta.apache.org/commons/beanutils/ . ...

69. Easy el question    coderanch.com

70. JSF-EL    coderanch.com

71. i get NoClassDefFoundError : javax / el / ELException    coderanch.com

Hi Thank you for reading my post. I do not know what is wrong but its two day that i get the above error. here is the complete stack trace of log files. Jan 13, 2007 12:52:43 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener java.lang.NoClassDefFoundError: javax/el/ELException at com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:94) at com.sun.faces.config.ConfigureListener.application(ConfigureListener.java:402) at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:444) at ...

72. Problem with el evaluation in a jspx    coderanch.com

73. EL expression using a declared var in data table    coderanch.com

Hi guys, I have a page with a Richfaces datatable that has a column for dynamic actions (command links) depending on the type of data in each row. I'm trying to use an EL expression to determine which actions to display. JSP:

74. Horrendous EL problem    coderanch.com

Hello, I have the following problem with Richfaces + Facelets: java.lang.NullPointerException at javax.el.BeanELResolver$BeanProperty.read(BeanELResolver.java:259) at javax.el.BeanELResolver$BeanProperty.access$000(BeanELResolver.java:209) at javax.el.BeanELResolver.getValue(BeanELResolver.java:60) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at org.apache.el.parser.AstValue.getValue(AstValue.java:118) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71) at javax.faces.component.UIOutput.getValue(UIOutput.java:184) at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262) at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592) at org.restfaces.application.RestViewHandler.renderView(RestViewHandler.java:148) at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108) at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) ...

75. PropertyNotFound in EL    coderanch.com

I've been working on an application and everything has been running fine. Suddenly, a few days ago, I'm getting an exception thrown: Aug 28, 2008 1:06:33 PM com.sun.facelets.FaceletViewHandler handleRenderException SEVERE: Error Rendering View[/index.xhtml] javax.el.PropertyNotFoundException: Property 'logout' not found on type com.company.product.controller.LoginController at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193) at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170) at javax.el.BeanELResolver.property(BeanELResolver.java:279) ... It's kind of odd that "logout" is being referred to as a property ...

76. Map within a Map in JSF-EL ?    coderanch.com

77. javax.el package    coderanch.com

I think you can get a copy from the Maven repositories or the jakarta website. But as Ulf noted, it's built into newer web application servers. A fact I learned the hard way when I switched over and had conflicts in the app I was using that had bundled the el jars into the WAR. Since this is the JSF forum, ...

78. How to put EL into setRendered()?    coderanch.com

79. Resolving EL    coderanch.com

Hi all, I have two command buttons on my jsp, which I should show or hide based on the user action for which I have set a property in by backed bean. i am using the rendered tag for this, the logic works fine I mean the buttons are displayed accordingly, but one of the button does not work having the ...

80. El expression in JSF    coderanch.com

A lot of times, a database will end up with the actual text word "null" in a column after a binding mechanism has been used to edit the table row. That happens when the display mechanism pushed the word "null" out to the user form and the user then sent it back. There's a big difference between no value (null) and ...

81. EL-rendering of if-then-else    coderanch.com

82. EL Question    coderanch.com

83. JSF EL conditional statement returning a jsf el syntax problem    coderanch.com

I am trying to use jsf el to to a conditional statement in my faces-config.xml file. #{ (currentUserRole.userInSecureRole==true) ? agsws3 : agsws0} works perfectly the problem is the next line needs to be #{ (currentUserRole.userInSecureRole==true) ? #{agsws3} : #{agsws0}} which of course doesnt parse basically if it fails check it needs to be agsws0 #{agsws0} and if it passes agsws3 #{agsws3} ...

84. JSF EL: nested ${}    coderanch.com

85. Nested EL in h:outputFormat    coderanch.com

86. An EL question    coderanch.com

87. Declarated variable in EL    coderanch.com

Hello I'm just starting to write my JSF application. It is ment for a school project so it's supposed to stay as JSF-way as possible. So my problem is: <%! private / public String foo; %> <% foo = "bar"; %> Compiler says that the value for a foo is eighter null or don't render the ...

89. Can I combine the 2 EL expressions?    coderanch.com

90. javax.el.MethodNotFoundException    coderanch.com

91. EL Expression    coderanch.com

93. EL expression not recoggnized    coderanch.com

94. EL 2.2 in JbossAS 6    coderanch.com

95. EL    coderanch.com

96. javax.faces.el.MethodNotFoundException in JSF    coderanch.com

Hi all, I have 2 text fields and one select drop down. The logic is that if i change the value in one text box the value in the other text box needs to be changed automatically based on a logic implemented in a method in the controller and vice versa. Code for Percentage text field

97. Getting EL targed annotations    coderanch.com

98. EL: Concatenation of property name    coderanch.com

I don't have the source code on this notebook, but the ui:repeat-part seemed to work fine, it was the concatenation that didn't work. Do you see anything wrong there? I called "getParts()" because it isn't a property in sense of having a getter and setter. It was just a method that provides me a list. (Which is always the same anyway.) ...

99. EL not evaluated    coderanch.com

100. EL expressions are not evaluated    coderanch.com

hi, My inputname.jsp file <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> enter your name page

My welcome.jsp file <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> ...