Expression « JSTL « JSP-Servlet Q&A

1. trimming a string in a JSTL expression

I have the following line in a JSP page:

<c:if test="${postAuditBean.postAudit.authority == authority.value}">
I would like change this comparison to first trim leading and trailing spaces from both the left and right hand ...

2. Error using JSTL XML taglib - attribute xml does not accept any expressions

I'm getting the following error when I try to use the JSTL XML taglib:

According to TLD or attribute directive in tag file,
attribute xml does not accept any expressions
I'm looking into ...

3. How to do this using java expression language

Let just say i have the following java object that I wish to read in my jsp using el:

class A {

 Map map = new HashMap();
 int count;


4. How do I determine where a JSTL expression variable (pageContext attribute) originated in IDEA?

We've got an app that makes heavy use of JSTL expressions and custom taglibs, which means our pageContext attributes could have been set just about anywhere. How do I go about ...

5. Using var in XPath expression inside c:foreach

this is my first question here, so please be gentle ;) I'm trying to loop through a list of items, and use the value of each item in an XPath expression: Works:

<c:forEach var="item" ...

6. JSTL expression evaluation from a string

Is it possible to evaluate a String as EL expression in JSP and get value from it? I need an expression like ${model.${fieldPath}} where fieldPath will contain the required object path ...

7. JSP EL expressions not working in tag files

We are trying to move our Java web application from a Tomcat 5.5 server to a more modern Tomcat 6.0.24 one, but we are having some problems with JSP EL. The expressions ...

8. Nested expression in JSP/JSTL

I am using JSPs for the view, and Spring MVC 3.0 for the controller. In my JSP, I want to show the current DateTime, for which I have the following code...

<c:set var="dateTimeDisplayFormat" ...

9. JSTL Expression Language accessing object properties

I was following a tutorial today that had me scratching my head for an hour. Consider:

public class MyClass {
    public int getTotal() {

10. How to use the JSTL "if" tag without getting "..attribute test does not accept any expressions"

I've been googling around for quite some time now and I've decided to ask this here, how would I make the following code work?

        <c:if ...

11. Can JSTL var names be set from expressions or do they have to be literal strings?

I'm new to JSTL and I want to generalize some functionality that's used multiple times in one tag into a separate tag. My idea is to pass this tag an array ...

12. jsp el logic question

I have something like this..

<c:if test="${(not empty students) && (studentID != null)}">
      <form:input path=studentsList[${studentID}].name">

13. how to disable EL expression for a few lines in JSP

In some JSP pages, I want to the page display

However, EL will try to evaluate "id" variable and leave it to blank(not find the variable) or the actual value.
I know ...

14. Whats the difference between JSP implicit object and EL expression implicit object?

I have started reading JSP. I came across JSP implicit object, say for example, session, application etc. And after reading EL expression, i came to know there are also implicit object ...

15. S2.1 - struts tags vs jstl expression language

I assumed that I had to use the struts tags. I noticed that my older ${} worked for my objects. Is there a compelling reason to use the longer struts tags instead of JSTL EL? Norris Shelton Software Engineer Sun Certified Java 1.1 Programmer Shelton Consulting, LLC ICQ# 26487421 AIM NorrisEShelton YIM norrisshelton

16. Using JSTL Expression Language with Struts 2 tags

Zoran, what do you want to script in the tags? I would be interested in a small example, only because I often find my use of JSTL is restricted to situations where I am not using taglibs. Which leads me to ask, if you rely on JSTL anyway, surely you use the Standard taglib tags? Adam Zoran Avtarovski on 06/09/07 05:20, ...

17. JSTL expression in custom tag?

18. JSTL: EL expressions are not evaluated

20. jstl "expression language ( "${...}" ) in static text

Hi, I'm a newbie user of jstl "expression language" . I've got it to work *within tags*, but not in static text. E.g: Here's how i use it in a tag: . This works fine and prints out "4". But here's how I use it in static text: This is some static text ${2+2} This does ...

21. JSTL out with JSP expression

28. JSTL Expressions

29. Expression Language(EL) and JSTL

30. JSTL and expression language

32. Rounding a value in jsp by using JSTL Expressions

Another potential way to do it is to use the tag It is almost equivalent to Math.round, but not quite. Math.round method always rounds a .5 up to the nearest whole number. The number formatter uses the ROUND_EVEN approach, meaning if it is rounding .5, it will round to the nearest EVEN number ...

33. JSTL expression value issue.

HI All , In the JSP , i have used JSTL . In my local windows m/c tomcat server the application is working properly. but the same war file at linux m/c tomcat server , the JSTL expressions are not working . Ex . if I set value using and to print i am doing ...

34. Jstl Expressions not rendering after database query

Hi Bear, I'm just doing a select query using jdbc and using a table with the needed expressions to resolve the values, which works find when left in the jsp page, but when I removed the whole table along with the EL expression and placed it in a column in the db table and replaced the code with ${content} in the ...