Importing Classes in JSP
As a JSP developer, you might encounter situations where you need to use classes other than those in the java.lang package. To utilize external classes, such as java.util.List, in your JSP page, you must import them using an import statement.
Importing a Single Class
To import a single class, like java.util.List, into your JSP page, use the following syntax:
<%@ page import="java.util.List" %>
Importing Multiple Classes
If you need to import multiple classes, you can use the following format:
<%@ page import="package1.myClass1,package2.myClass2,....,packageN.myClassN" %>
For example, to import java.util.List and java.util.Map, you would use:
<%@ page import="java.util.List,java.util.Map" %>
The above is the detailed content of How Do I Import Classes into My JSP Pages?. For more information, please follow other related articles on the PHP Chinese website!