JSP导入java类方法是靠import指令。
jsp引入java的单个类的写法:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>//主要是这句
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
引入多个类的写法:
<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="UTF-8"%>//主要是这句,中间用逗号隔开
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
导你所需要的包以后
<%
类名.对象 = new 类名();//这个对象就能用了
%>
<%@ page language="java" contentType="text/html; charset=windows-31j"
pageEncoding="windows-31j" import= "com.ss.类"%>import后面写路径就可以
<%@ page import="com.yourClass"%>
跟类中导包一样吧
跟那个一样的