JSP basics: import a Java class for use in a JSP
Importing Java classes enables the use of that class without using the fully qualified class name. Java classes can also be imported into JSPs with page directives.
To import the Java class java.util.Calendar for use in a JSP, use one of the following:
<%@page import="java.util.Calendar"%>











102 said on November 27, 2008
thanks a lot :D
george said on April 5, 2009
If you wrote your own class where do you put it in the file system to access it from JSP?
Anonymous said on June 26, 2009
If you are using the Apache Tomcat server to serve up your JSP pages, then I would recommend putting your own class packages in ${TOMCAT_BASE}/common/lib/
For our implementation here, it’s /opt/tomcat5/common/lib/.
HTH. Enjoy.
Barack said on April 4, 2010
I don’t know what the problem is (because I’m browsing using Chrome maybe?), but I just see two empty grey ruled-out DIVs below “To import the Java…” .
anonymous said on June 19, 2010
And yes. It’s because of chrome (i’d that problem too)
CPsychoD said on October 31, 2010
well, you can just put them in the same folder as the JSP? and also i assume any version is usable, starting from 1.4.2, the hoster probably has the latest version installed right?