在JSP中可以使用<%@page%>导入所需要的包,代码如下:
<%@ page contentType="text/html" language="java" import="java.util.*" pageEncoding="GBK"%> <%@ page import="cn.edu.imau.zhw.*" %> <html> <head> <title></title> </head> <body> <% SimpleBean simple=new SimpleBean(); simple.setAge(22); simple.setName("xxx"); %> <h3>姓名:<%=simple.getName() %></h3> <h3>年龄:<%=simple.getAge() %></h3> </body> </html>