Questions tagged [el]
EL (Expression Language) enables the dynamic resolution of Java objects and methods in JSP and Facelets pages. EL expressions take the form of ${foo} and #{bar}.
2,577
questions
1
vote
1
answer
25
views
IllegalAccessException when accessing ZoneInfo via JSF/EL with JDK 17
While porting a big JEE8 application to Java 17, I stumbled upon an IllegalAccessException when rendering a simple EL expression: #{myWarBean.defaultTZ.rawOffset}. I managed to reproduce the problem ...
-2
votes
0
answers
23
views
How to use EL expression in another EL expression in JSTL [closed]
<c:forEach begin="1" end="3" var="i"> ${t.OPT_DESC_${i}} </c:forEach>
0
votes
0
answers
31
views
JSP EL doesn't evaluate static fields in Weblogic
I'm using Weblogic 12c, the webapp is of servlet version 3.1.
I struggle how to evaluate static fields by EL.
Java Class:
package com.example;
public class MyClass {
public static final String ...
0
votes
0
answers
13
views
Gatling:If session exist attribute set the #{attribute} to real value, and if its null set #{attribute} to null, how can I do?
Our API sequence is A->B
1step: extract API A's discountPremuim and set it to session
.check(jsonPath("$[0].discountPremium").optional.saveAs("discountPremium"))
2step: API B’s ...
0
votes
1
answer
33
views
Does any one know how to create Empty Array In JSTL (JSP Standard Tag Library)
I am trying to create an empty in my jstl page is it possible to create an empty array and assign some value to that array in the jstl page itself .?
0
votes
1
answer
42
views
Comparing enum value inside EL fails
I am trying to compare an enum in a JSP page inside an EL. This should be supported for EL version 3.0 - which I am using - and later. This is the code and configuration files I am using:
index.jsp:
&...
0
votes
0
answers
18
views
JSF EL expression equals always false [duplicate]
JSF EL expression:
rendered="#{param.type == xyz}"
The value is false for URL
http://domain/?type=xyz
also tried:
rendered="#{param.type eq xyz}"
0
votes
0
answers
14
views
Conditional JSP tag-attribute
Is there a way to conditionally omit a JSP tag attribute? I have a template that is called multiple times and the tag has to be set conditionally.
I tried to pass null:
<sometaglib:sometag ...
0
votes
1
answer
32
views
JSF: how to tell if a ValueExpression does not exist or actually its value is null?
FacesContext context = FacesContext.getCurrentInstance();
ELContext ctx = context.getELContext();
ValueExpression expression = context.getApplication().getExpressionFactory().createValueExpression(
...
0
votes
0
answers
52
views
JSF selectOneMenu converter null or class cast exception
JVM Version: 14.0.2+12-46
myfaces-api 2.3.9
myfaces-impl 2.3.9
apache-tomee-webprofile-8.0.4
I am using the following converter for an simple entity class:
package view;
import entities.Chain;
...
0
votes
0
answers
46
views
Expression language 3.0 with Weblogic 12.2.1.4.0 not working
Dears,
I am using expression language in my JSP to access Enum values, example:
<c:choose>
<c:when test="${request.status eq RequestStatusEnum.PENDING}">
<p class="...
0
votes
0
answers
34
views
Expression language evaluates properly in local but doesn't work when I deploy my application
I have a JavaScript array in my JSP file that gets its contents from a Java array. It looks like this:
var myArray = [];
<c:forEach items="${myList}" var="i">
myArray.push(&...
0
votes
0
answers
32
views
Conditional checking with class names not working with tomcat in primefaces xhtml
I am using rendered attribute like rendered="#{(column[0].class.name == 'java.lang.String')}". It was working fine with my wildfly server. I have switched to tomcat and using class.name == ...
0
votes
0
answers
17
views
EL ternary condition not working as expected [duplicate]
I am getting this error message when changing the value of the selectOneRadio Button below :
Exception: javax.faces.component.UpdateModelException: javax.el.PropertyNotWritableException: /pages/tags/...
0
votes
1
answer
79
views
How can I cast from double to int in jstl?
This is my jstl version
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
I want to cast from double to int like in Java.
${(int)(Math.toDegrees(city.latitude))...
1
vote
0
answers
94
views
org.apache.camel.ValidationException: Allowed body types are String or InputStream
I'm getting type compatibility issue while using EL to parse the request body in JSON. Can some one help me on this ?
from("file-watch:test?events=CREATE&useFileHashing=true&antInclude=**/...
0
votes
0
answers
79
views
Cypress - A modal which is supposed to be visible after clicking an element is not opening up after the click
I am trying to validate a popup modal after clicking on an element.
During the test run, the click command is successfully completed but the modal is not visible.
I stopped running the test and then ...
1
vote
0
answers
16
views
EL expression for label not resolved
This is a follow up for my FindComponent + set invalid challenge question...
In that question it all worked fine for static strings, like:
<p:inputText id="val2" readonly="true" ...
0
votes
0
answers
78
views
How do I use EL to evaluate the length of an array in a (JSR 380) constraint message?
I have a constraint on which I want to use EL to tune the message to the circumstances. Dependent on the length of an array, I want to show a different message. However, I'm having trouble getting the ...
0
votes
0
answers
20
views
EL doesn't recognize variable
I declared ArrayList variable above.
However, JSP EL Expression doesn't recognize the variable .
How can I fix it?
enter image description here
0
votes
0
answers
47
views
Hibernate Validator without EL interpolation
I would like to turn off Expression Language interpolation in the Hibernate Validator, on version 5.3 but it seems to be available only from version 6.2.
Is it possible somehow? I see that, maybe it ...
0
votes
0
answers
18
views
Tag defined ui:composition - method not found, misinterpreted as property [duplicate]
I want to define a composite component for a dataTable, so I have followed How to create a composite component for a datatable column? and followed the top-answer.
I use Java 16 with JSF 2.3 and ...
3
votes
0
answers
41
views
Wicket alike property substitution
When reading properties in a Wicket Application we can have properties like this and the values will be automatically replaced with the values of the model object.
weather.message=Weather station ...
1
vote
1
answer
128
views
SPEL how to protect against injection attacks
some code like this
StandardEvaluationContext context = new StandardEvaluationContext();
context.addPropertyAccessor(new EmptyValueMapAccessor());
context.addPropertyAccessor(new ...
0
votes
0
answers
76
views
javax.faces.component.UpdateModelException: javax.el.PropertyNotFoundException. Target Unreachable, identifier resolved to null
Solution of this question already exists in stackoverflow. Although I have asked this question, it is because all available answers doesn't solve my problem/error. So I have asked this question so ...
1
vote
0
answers
69
views
Using JSP EL "eq" or "==" with different object types throws error
I am in the process of upgrading a Spring application from Java 8 / WildFly 12 to Java 11 / WildFly 22.
It seems that something has changed in the way the Expression Language (EL) handles the "eq&...
1
vote
1
answer
65
views
Exception trying to poll with PrimeFaces
I am getting an exception trying to poll with PrimeFaces. I'm using solution #1 from Primefaces fileUpload and session timout.
javax.faces.FacesException: class java.lang.Long is not supported as &...
0
votes
0
answers
28
views
How to programmatically evaluate jsf inside a management bean?
In a web application the management of entities is realized with almost boiler plate CRUD logic.
After the creation of an entity the browser shows a page where a datagrid lists the most important ...
0
votes
0
answers
20
views
Reference JSF managed bean property via EL in CSS resource [duplicate]
I have the following situation:
here is style.css where I import another css @import "themes/theme1.css"; h1{color: var(--mainColor); }
theme1.css looks like this :root{--mainColor: #1D3557;...
2
votes
1
answer
1k
views
Is it possible in vue3 to access the root DOM element in a child component slot? I am trying to use a 3rd party library (sortablejs) in vue3
In vue2 I could use this.$el
export default {
render() {
return this.$slots.default[0]
},
mounted() {
Sortable.create(this.$el, {});
})
}
If, in vue3 I try to use this.$slots.default()[0] I can't ...
0
votes
0
answers
19
views
How to use a class that is not a ManagedBean in JSF view?
I have an utility class that is not a ManagedBean, and I do not want to transform it in a ManagedBean.
In past I read that there's a way to specify classes to be exposed to JSF using faces-config.xml, ...
0
votes
0
answers
20
views
Is it possible to use EL as a standalone template language? [duplicate]
I need to generate a PDF using Flying Saucer. Is it possible to insert EL expressions in the PDF template, load the file, pass to a EL compiler with a Map<String, Object> as a context, and let ...
0
votes
0
answers
18
views
javax.faces.FacesException: #{completedAction}: javax.el.MethodNotFoundException but action is work [duplicate]
I have modal window with command button.
<p:commandButton id="okButton" value="#{msg['button.ok']}" action="#{completedAction}" immediate="true" rendered=&...
0
votes
1
answer
49
views
<c:if test = "${product.categoryid}==${loop1.index+1}"> does not seem to work [duplicate]
I have two array lists, a category and a product array list, in my servlet
@WebServlet(urlPatterns = "/homepage.do")
public class HomePageServlet extends HttpServlet {
Category category =...
0
votes
0
answers
89
views
Springboot RequestMapping value and path resolving inexistent EL placeholder
Recently I observed that if an inexistent EL placeholder is inside a path or value property, it resolves to a "/$" output.
This behavior was observed in a Feign Client.
@PostMapping(
value ...
1
vote
0
answers
253
views
JSF Primefaces 10: How to set p:datePicker's maxdate attribute to tens years from now, dynamically?
Am using Java 1.8, Primefaces 10.0.0 on Tomcat 8.5.55... Am fairly new to JSF UI programming. Have a custom date JSTL tag where I need to dynamically set the maxdate to be 10 years from now when using ...
0
votes
0
answers
31
views
/index.xhtml @11,63 value="#{user.name}": Target Unreachable, identifier 'user' resolved to null [duplicate]
I keep getting error code (as seen in the images attached):
/index.xhtml @11,63 value="#{user.name}": Target Unreachable, identifier 'user' resolved to null
Also I have attached my managed ...
-5
votes
1
answer
65
views
Equals in EL: what if the first operand is null?
If I have an EL expression like this one:
#{a == b}
what happens if a is null? There is some difference between different versions of EL?
Where can I found an official specs that explain that?
0
votes
0
answers
25
views
Am unable to send data with <f:param> in jsf to desply title(result when mouse moved on commantLink)
my jsf code for title (the result show when mouse over command link).
<h:commandLink value="MOS" id="visibility_recorded_calls_mos_link" action="#{...
1
vote
1
answer
147
views
Is it possible to get a list of Dog from a list of Animal without a cast?
I have a protected Map<String, List<Animal>> animals; in my class. In my constructor, I have
animals.put("dogs", new ArrayList<Animal>());
animals.put("cats", new ...
0
votes
0
answers
16
views
Using programmatic element ids in EL [duplicate]
I'm trying to get an element with a programmatically constructed id using EL in JSP. These ids follow the pattern table_1, table_2, table_3, etc. Earlier versions without the generated ids got them ...
0
votes
0
answers
60
views
Failed to start application: Unable to locate the EL RI expression factory
I am getting the following exception when starting my application:
com.sun.faces.config.ConfigurationException: It appears the JSP version of the container is older than 2.1 and unable to locate the ...
0
votes
0
answers
29
views
How to set a dynamic value for ui:param [duplicate]
I have several pieces of this JSF code:
<h:panelGroup rendered="#{bean.myParam == '1'}">
<ui:include src="/view1.xhtml">
<ui:param name="var" ...
2
votes
1
answer
394
views
Spring migration 4.3 to 5 on tomcat 8.5 el-api error
When upgrading our Spring 4.3 to 5 using Spring boot initializer on tomcat 8.5, we started getting exceptions:
2021-06-06 12:37:50,482 DEBUG [background-preinit] messageinterpolation....
0
votes
1
answer
43
views
Why is only the getter invoked on the inputText value expression?
<h:form>
First Name: <h:inputText value="#{studentFormBean.fname}" /> <br/><br/>
Last Name: <h:inputText value="#{studentFormBean.lname}" /> &...
0
votes
0
answers
99
views
Fetch from Cache Jolt Spec with Expression language and putting attribute doesn't calculate Expression language
I have stored Jolt Spec which has expression language
[
{
"operation": "modify-overwrite-beta",
"spec": {
"id": "${UUID()}"
}...
0
votes
0
answers
18
views
javax.el.PropertyNotFoundException: Target Unreachable, identifier 'IndexBacking' resolved to null [duplicate]
I am trying to develop a JEE application deployed in an EAR.
I have an EJB project and a Dynamic Web project that uses the JSF specification.
Some infos:
My web application server is Glassfish 5.0.1.
...
0
votes
1
answer
189
views
JSF Primefaces: How to set default value of <f:selectItems> using specific ordinal in enum?
Am using Java 1.8, lombok and the following version of JSF Primefaces in my pom.xml:
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</...
0
votes
1
answer
156
views
Camel blueprint <setHeader headerName="CamelHttpPath" id="_setHeader1"><el>${header.uriPattern}</el></setHeader> waiting for dependencies
I have the following Camel Context.
<camelContext id="_camuatomicservicecontext" xmlns="http://camel.apache.org/schema/blueprint">
<route id="...
1
vote
0
answers
26
views
JSF datatable - method always gets called with last element in datatable
I have component thats basically datatable made of list of buttons. Each button opens dialog thats another component, and passes current var of datatable to this component (dialog). Inside dialog ...