What is import attribute in JSP?

The import attribute serves the same function as and behaves like, the Java import statement. The value for the import option is the name of the package you want to import.

To import java.sql.*, use the following page directive −

<%@ page import = "java.sql.*" %>

To import multiple packages, you can specify them separated by comma as follows −

<%@ page import = "java.sql.*,java.util.*" %>

By default, a container automatically imports java.lang.*, javax.servlet.*, javax.servlet.jsp.*, and javax.servlet.http.*.

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know