Questions tagged [jstl]
JSTL (Jakarta Standard Tag Library) is a XML based standard tag library which offers tags to control the flow in a Facelets or JSP page, date/number formatting and internationalization facilities and several utility EL functions.
jstl
698
questions
177
votes
3
answers
101k
views
JSTL in JSF2 Facelets... makes sense?
I would like to output a bit of Facelets code conditionally.
For that purpose, the JSTL tags seem to work fine:
<c:if test="${lpc.verbose}">
...
</c:if>
However, I'm not sure if ...
191
votes
23
answers
493k
views
How to install JSTL? It fails with "The absolute uri cannot be resolved" or "Unable to find taglib" or NoClassDefFoundError or ClassCastException
I don't know what I've done incorrectly, but I can't include JSTL. I have jstl-1.2.jar, but unfortunately I get exception:
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/...
32
votes
6
answers
147k
views
javax.el.PropertyNotFoundException: Property 'foo' not found on type com.example.Bean
I have results from
Query query = session.createQuery("From Pool as p left join fetch p.poolQuestion as s");
query and I would like to display it on JSP.
I have loop:
<c:forEach items="${pools}"...
21
votes
1
answer
30k
views
JSTL c:if doesn't work inside a JSF h:dataTable
I'm trying to use <c:if> to conditionally put a <h:outputLink> inside a <h:dataTable> when the state is finished.
<h:dataTable value="#{bean.items}" var="item" width="80%">
...
4
votes
1
answer
4k
views
Collect and save submitted values of multiple dynamic HTML inputs back in servlet
I am able to display an ArrayList of beans in a JSP form using JSTL by looping through the list and outputting the bean properties in a HTML input tag.
<c:forEach items="${listOfBeans}" var="bean"&...
427
votes
8
answers
849k
views
Evaluate empty or null JSTL c tags
How can I validate if a String is null or empty using the c tags of JSTL?
I have a variable named var1 and I can display it, but I want to add a comparator to validate it.
<c:out value="${var1}...
45
votes
2
answers
126k
views
How to compare two object variables in EL expression language?
I am creating a drop down list of all languages. The default language selection for the list will be determined by information added by the user:
<select>
<c:forEach items="${languages}"...
35
votes
4
answers
64k
views
How to iterate an ArrayList inside a HashMap using JSTL?
I have a map like this,
Map<Integer,ArrayList<Object>> myMap = new LinkedHashMap<Integer,ArrayList<Object>>();
Now I have to iterate this Map and then the ArrayList inside ...
86
votes
5
answers
149k
views
EL access a map value by Integer key
I have a Map keyed by Integer. Using EL, how can I access a value by its key?
Map<Integer, String> map = new HashMap<Integer, String>();
map.put(1, "One");
map.put(2, "Two");
map.put(3, "...
15
votes
2
answers
45k
views
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
I am developing an application for FB Login with website using Javascript and JSF. I have posted my code at here. The problem is, when I run my application it does't show the JSF page, it instead ...
9
votes
3
answers
15k
views
How to access objects in EL expression language ${}
If I have a
ArrayList<Person> persons
How do I access it in EL?
<c:foreach items="${what goes here??}" var="person">${person.title}</c:foreach>
64
votes
18
answers
236k
views
Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core” [duplicate]
I have included this at the very top of my JSP page:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
I already placed the JSTL JAR file in the WEB-INF/lib directory. But still,...
15
votes
3
answers
63k
views
javax.servlet.ServletException: javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in <forEach>
I have a Bean that holds the results. I need to use JSTL to iterate over it and present the results. Here is the bean:
public class DetResults
{
private List<String> headings;
private ...
26
votes
5
answers
23k
views
How to concatenate a String in EL?
How do I get the promoPrice variable to print as part of the string ONLY $4.67?
<c:set var="promoPrice" value="4.67" />
<p>${(promoPrice != null) ? "ONLY $${promoPrice}" : "FREE"}</p&...
45
votes
4
answers
73k
views
How to call parameterized method from JSP using JSTL/EL
How to call a Java method with arguments which is defined in Java class, from JSP using JSTL/EL. The method is returning arrays. Any return value can be used.