Skip to main content

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.

4 votes
4 answers
13k views

Howto deactivate caching inside a jsp page

I understand there is a HTTP response header directive to disable page caching: Cache-Control:no-cache I can modify the header by "hand": <%response.addHeader("Cache-Control","no-cache");%> ...
Eduard Wirch's user avatar
  • 9,862
2 votes
3 answers
5k views

Can I use a Hashtable in a unified EL expression on a c:forEach tag using JSF 1.2 with JSP 2.1?

I have a Hashtable<Integer, Sport> called sportMap and a list of sportIds (List<Integer> sportIds) from my backing bean. The Sport object has a List<String> equipmentList. Can I do the ...
Joe Dean's user avatar
  • 3,366
108 votes
13 answers
125k views

Access Enum value using EL with JSTL

I have an Enum called Status defined as such: public enum Status { VALID("valid"), OLD("old"); private final String val; Status(String val) { this.val = val; } public ...
IaCoder's user avatar
  • 12.6k
29 votes
7 answers
82k views

accessing constants in JSP (without scriptlet) [duplicate]

I have a class that defines the names of various session attributes, e.g. class Constants { public static final String ATTR_CURRENT_USER = "current.user"; } I would like to use these constants ...
Dónal's user avatar
  • 186k
21 votes
7 answers
58k views

Calculate total sum of all numbers in c:forEach loop

I have a Java bean like this: class Person { int age; String name; } I'd like to iterate over a collection of these beans in a JSP, showing each person in a HTML table row, and in the last row ...
Dónal's user avatar
  • 186k
3 votes
2 answers
5k views

How does jstl's sql tag work?

I'm using the following code to query a database from my jsp, but I'd like to know more about what's happening behind the scenes. These are my two primary questions. Does the tag access the ...
ScArcher2's user avatar
  • 86.9k
14 votes
5 answers
131k views

test attribute in JSTL <c:if> tag

I saw some code like the following in a JSP <c:if test="<%=request.isUserInRole(RoleEnum.USER.getCode())%>"> <li>user</li> </c:if> My confusion is over the "=" that ...
Dónal's user avatar
  • 186k
18 votes
2 answers
43k views

Formatting a long timestamp into a Date with JSTL

I am pulling a long timestamp from a database, but want to present it as a Date using Tags only, no embedded java in the JSP. I've created my own tag to do this because I was unable to get the ...
scubabbl's user avatar
  • 12.7k
1 vote
5 answers
17k views

In JSTL/JSP, given a java.util.Date, how do I find the next day?

On a JSTL/JSP page, I have a java.util.Date object from my application. I need to find the day after the day specified by that object. I can use <jsp:scriptlet> to drop into Java and use java....
Sean McMains's user avatar
  • 58.8k
0 votes
2 answers
3k views

How do I get rid of "Cannot resolve property key" in fmt:message tags in JSPs in Intellij

This one has been bugging me for a while now. Is there a way I can stop Intellj IDEA from reporting missing keys in tags? My messages are not stored in property files so the issue does not apply in ...
Sindri Traustason's user avatar
45 votes
14 answers
105k views

How can I replace newline characters using JSP and JSTL?

I have a list of bean objects passed into my JSP page, and one of them is a comment field. This field may contain newlines, and I want to replace them with semicolons using JSTL, so that the field can ...
parkerfath's user avatar
  • 1,649
0 votes
2 answers
2k views

Embedded custom-tag in dynamic content (nested tag) not rendering

Embedded custom-tag in dynamic content (nested tag) not rendering. I have a page that pulls dynamic content from a javabean and passes the list of objects to a custom tag for processing into html. ...
Doug Miller's user avatar
  • 1,346
7 votes
1 answer
1k views

Which JSTL URL should I reference in my JSPs? [duplicate]

I'm getting the following error when trying to run a JSP. I'm using Tomcat 6.0.18, and I'd like to use the latest version of JSTL. What version of JSTL should I use, and which URL goes with which ...
ScArcher2's user avatar
  • 86.9k

15 30 50 per page
1
362 363 364 365
366