Link to home
Start Free TrialLog in
Avatar of Mark
Mark

asked on

jsp - Calendar class not working

I have jsp code:
<%@ page import="java.util.Calendar" %>
Calendar thisYear = new GregorianCalendar();

But, this doesn't work. I get the error: "GregorianCalendar cannot be resolved to a type"

What am I doing wrong? In the alternative, I'm just trying to get the current year. Alternate suggestions?
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

You haven't imported GregorianCalendar
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You have to do

<%@ page import="java.util.GregorianCalendar" %>
Avatar of Mark
Mark

ASKER

CEHJ: including <%@ page import="java.util.GregorianCalendar" %> let me compile, but your 2nd suggestion is all I need. Thanks!
No problem :-)
Avatar of Mark

ASKER

I thought I accepted this already!
:-)