tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Watts <>
Subject Invoke methods in EL?
Date Mon, 10 Apr 2017 15:35:45 GMT
Environment: Tomcat 7.0.59; JRE 1.8.0_72

I suspect the answer to my problem is "You can't do that" but here goes:

A simple JSP that tries to get a Calendar instance and outputs the year:

<%@ page language="java" 
    charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="" %>
<!DOCTYPE html>
	<c:set var="X" value="${ java.util.Calendar.getInstance() }"/>
	<c:set var="Y" value="${ X.get(java.util.Calendar.YEAR) }"/>
	The year is ${ Y }

This presents a page that just says "The year is" but no year value.  Is
there some syntactical mojo I'm missing or is my best alternative to
resort to a scriptlet?  

(And for context, I actually want to do something along these lines in a
tag file.)

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message