how to import class in jsp


How to import class in jsp

import keyword is use to import classes in JSP page.

Example

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
 pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>www.javagf.com</title>
</head>
<body>
    <%@ page import="java.util.Date"%>
    <h2>Todays Date and Time: <%=new Date()%></h2>
</body>
</html>

Output

Today's Date and Time: Fri Jan 20 14:21:51 IST 2017






Full-stack web and mobile app development company Contact Us : Skype: indore.webcoder Email: info@w3sparks.com Sales: +91 8085506229