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}.

Filter by
Sorted by
Tagged with
0 votes
0 answers
27 views

c:forEach calls its getter for each p:remoteCommand [duplicate]

I do have an JEE application with JSF. As soon as I do use the c:forEach element, then the backend call for detecting the items is called with each p:remoteCommand, talking to the backend, even if no ...
Martin Metz's user avatar
-1 votes
1 answer
23 views

Literally causing a StackOverflowError - Tiles 3

Migrating from the Struts 1.3/Tiles 1.x combo to the Struts 2/Tiles 3. But this is really a Tiles question Previously there was support for a bean declaration within the definition to support ...
Arbuz Melon's user avatar
1 vote
1 answer
61 views

How to format a number which is part of the value of p:outputLabel

I have this JSF .xhtml code: <p:outputLabel value="#{bundle['my.bundle.name']} - #{Myclass.current.amount}"/> Myclass.current.amount is a double in Java. There is a problem in ...
Владимир Царьков's user avatar
1 vote
0 answers
42 views

Accessing null keys in maps with EL

I have a Map<Person, Map<String, Integer> > that can contain a null Person key. This is intended. In my JSF page: <ui:repeat var="svc" value="#{bean.services}"> ...
Edward's user avatar
  • 580
0 votes
0 answers
11 views

Method not found: class com.sun.el.stream.Stream.collect(null) [duplicate]

I am trying to use the java.util.stream.Stream class in a JSF application running on Payara Server 5 with JDK 11, but I keep getting a javax.el.MethodNotFoundException with the message "Method ...
Buddhika Ariyaratne's user avatar
0 votes
1 answer
64 views

Java EL parser experiments

I'm playing full of curiosity with the EL parser of java, the goal is to make a .jsp execute java code in oneline This is the code: ..... String input1 = request.getParameter(&...
jagghy's user avatar
  • 117
0 votes
0 answers
21 views

How do I solve "Target Unreachable, identifier 'loginBean' resolved to null" error?

I'm using JSF on NetBeans. I have an xhtml page and a bean class. When I run it I keep getting this : enter image description here after I input username and password. My bean class is (beginning of ...
Omri's user avatar
  • 3
0 votes
1 answer
49 views

JSP does not recognize the fn prefix when compiling

I'm unfamiliar with Jsp and Jstl , I created this little comparator to sort all my users by name: <c:set var="userList" value="${fn:toList(users)}"/> <c:set var="...
Jacket's user avatar
  • 353
0 votes
0 answers
25 views

Data and Images are not being displayed on JSP page and I couldn't figure it out why? [duplicate]

I am working on a personal project to get some coding practice with JSP and servlets. I am using MySql for storing data and I want to render 'user' data to user_list.jsp. Even though the page is ...
Sid's user avatar
  • 122
1 vote
1 answer
53 views

Substring function in JSP does not respond in an alert function

The following code does not show the alert of "abc" but there is no any error message? Any idea to solve it? <%@ include file="includes.jsp"%> <script src="js/...
SBMVNO's user avatar
  • 570
0 votes
0 answers
29 views

Evaluate EL expression from string as bean in JSF page

I am fairly new to JSF and am currently a frontend developer for a new project. I do not have access to the backend code and need to create a solution with the data I have access to on the page. ...
Jim Burke's user avatar
0 votes
0 answers
36 views

JSTL: The method is undefined for the type String [duplicate]

I am learning JSP and JSTL through a book, in said book they mention this example code: <c:if test="${ 'POST'.equalsIgnoreCase(pageContext.request.method) }"> The method doesn't seem ...
getNoodle's user avatar
0 votes
1 answer
372 views

How can I put a Kubernetes Secret in a Cronjob curl command?

In kubernetes I have a secret defined, and in my deploy-templates YAML files, I have that secret set as ${mySecret}. I am trying to create a CronJob that uses the following CURL to run the Job with ...
Cody M.'s user avatar
0 votes
1 answer
67 views

How does EL know which methods of which Java files to call? [duplicate]

I came across the following code: <c:set var="list value="${actionBean.ABC}"> in a JSP file. Then I found it is calling the following method in one of the Java files: List<...&...
shole's user avatar
  • 4,048
0 votes
1 answer
70 views

Do Eclipse IDE have support to java code completion into EL expression? [duplicate]

I am recently testing Eclipse IDE for my jsf web project using primefaces. But I find that it doesn't fill me in with java code embedded within the value of an EL expression like other Ides like ...
Nebulak's user avatar
  • 26
0 votes
0 answers
389 views

jakarta.servlet.ServletContext from jakarta.faces.context.FacesContext to getAttribute("AnAttributeName")

This is a piece difficult,It's JSF i'm using jakarta faces api 3.0.0 , it seems in a ManagedBean calling FacesContext to acquire the jakarta.faces.context.ExternalContext and use its getContext method ...
Samuel Marchant's user avatar
0 votes
0 answers
17 views

How to print a char array from a bean using EL - ${attributeObject.charArrayVariable} prints its hashcode instead

There is a 3 character char[] variable in bean object which is set as a request attribute. When forward is executed, I am trying to print this variable using EL ${customer.code} in JSP page in a table ...
A V's user avatar
  • 1
1 vote
0 answers
9 views

pass variable to java class function in jstl couse wierd error [duplicate]

I'm trying to build shopping cart in jsf. I'm using jstl to read data from data base(works fine), the problem is when i send my var(p in this case) to function in shoppingCartController that is @...
Gal Lisha's user avatar
0 votes
0 answers
35 views

How can I call a constructor in a EL expression?

Is there a way to do something like: <c:set var="date" scope="page" value="${new Date()}"/> Notice that Date is just an example.
Gustavo's user avatar
  • 1,332
1 vote
0 answers
140 views

How do I use a Java method inside the JSP page and pass an EL value as an argument? [duplicate]

I have just a question about passing parameters to the java method inside JSP. I have a java class called ParameterCrypto and it contains decode(String str) and encode(String str) static methods. I ...
Hirantha's user avatar
0 votes
0 answers
87 views

How to create a map object using Java Expression Language 6 and modify its properties and add new properties?

This question is based on a Java EE 6 Expression Language. This is a workflow-based platform where you can add a step in a process to initialize variables and the value is specified as an expression ...
tarekahf's user avatar
  • 708
0 votes
0 answers
42 views

How to use el expression in pg:pager?

I just got someone's code and have to check and modify until I could avoid all the high, medium and low risks scanned by CheckMarx 9.4.4. However, I got a lot of low risk called "Escape_False&...
fu liao's user avatar
0 votes
1 answer
37 views

How to reference a method in EL which does not meet naming convention

Java List type does not have a getSize() method. Is there a way to tell reference the size() method in EL instead? I've tried #{aList.size > 10} but that is not working.
eastwater's user avatar
  • 4,456
0 votes
1 answer
37 views

how to put ${status.index} inside another el? like this "${errors.hasFieldErrors('list[ ${status.index} ].count') }"

<c:forEach items="${list.productList}" var="dto" varStatus="status"> <tr> <td></td> <td></td> <td></td> </tr> ....
nextlevel's user avatar
0 votes
0 answers
83 views

Invoking get method in EL expression causes conversion error

I have a JSF hidden input on my app view that holds some object's attribute: <h:inputHidden id="hidMyData" value="#{bean.myList.get(bean.listIndex).someAttr}" immediate="...
peterremec's user avatar
-2 votes
1 answer
69 views

NullPointerException but why? [duplicate]

I have class where @Enumerated(EnumType.STRING) private StateOfDispatchToWD stateOfDispatchToWD = StateOfDispatchToWD.NONE; And getter and setter: public StateOfDispatchToWD ...
Martin Hofman's user avatar
1 vote
0 answers
87 views

SpEL Map get value by dynamic key name in JavaScript

Sorry my English is poor. I have a question. In JavaScript , I can get value like this code: console.log("${testMap['0']}"); //return 'some string'; When I change my code like this ,I can't ...
Chris Chiu's user avatar
0 votes
0 answers
21 views

How to show formated date in input form in JSP using JSTL tags & converting Java code to JSTL [duplicate]

I have two issues,one is why can't i show the formatedDate using ${formatedDate} in the forms. Second is how can I convert the java code to format date in JSTL? Is there a reference or something where ...
Ali 's user avatar
  • 469
3 votes
1 answer
527 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 ...
Martin Höller's user avatar
0 votes
2 answers
208 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 .?
Ritesh Ghule's user avatar
0 votes
1 answer
155 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: &...
gzuhng's user avatar
  • 5
0 votes
1 answer
85 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( ...
eastwater's user avatar
  • 4,456
0 votes
0 answers
226 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; ...
Daniel Maldonado's user avatar
0 votes
0 answers
72 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 == ...
Ankit's user avatar
  • 63
0 votes
1 answer
624 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))...
Zakhar Borisov's user avatar
1 vote
0 answers
463 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=**/...
TechGeek's user avatar
  • 470
0 votes
0 answers
661 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 ...
user17840453's user avatar
1 vote
0 answers
22 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" ...
Betlista's user avatar
  • 10.3k
0 votes
0 answers
236 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 ...
SQB's user avatar
  • 3,906
0 votes
0 answers
23 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
DAEHYUN KIM's user avatar
3 votes
0 answers
47 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 ...
magicmn's user avatar
  • 1,786
1 vote
1 answer
544 views

SPEL how to protect against injection attacks

some code like this StandardEvaluationContext context = new StandardEvaluationContext(); context.addPropertyAccessor(new EmptyValueMapAccessor()); context.addPropertyAccessor(new ...
ying's user avatar
  • 13
0 votes
0 answers
263 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 ...
paawan's user avatar
  • 111
1 vote
0 answers
176 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&...
Ryan Griffith's user avatar
1 vote
1 answer
204 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 &...
CaptainB's user avatar
0 votes
0 answers
21 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;...
Rattus's user avatar
  • 3
4 votes
1 answer
2k 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 ...
Simon M's user avatar
  • 41
0 votes
0 answers
33 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, ...
Marco Sulla's user avatar
  • 15.1k
0 votes
0 answers
22 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 ...
Marco Sulla's user avatar
  • 15.1k
0 votes
1 answer
55 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 =...
Babi B's user avatar
  • 173

1
2 3 4 5
52