1.---The absolute uri: http://java.sun.com/jsp/jstl/functions cannot be resolved in either web.xml or the jar files deployed with this application---
解:jstl问题,你最好下载jatl.jar和stander.jar放在tomcat的lib中。我已解决。
2.回调函数:
所谓的回调,就是程序员A写了一段程序(程序a),其中预留有回调函数接口,并封装好了该程序。程序员B要让a调用自己的程序b中的一个方法,于是,他通过a中的接口回调自己b中的方法。
A方法不能改,写死,但是预留接口;B方法调用,在里面改动。
public interface CallBack {
//执行回调操作的方法
void execute();
}
A:
public void testTime(CallBack callBack) {
long begin = System.currentTimeMillis(); //测试起始时间
callBack.execute(); ///进行回调操作
long end = System.currentTimeMillis(); //测试结束时间
System.out.println("[use time]:" + (end - begin)); //打印使用时间
}
B:
public static void main(String[] args) {
Tools tool = new Tools();
tool.testTime(new CallBack(){
//定义execute方法
public void execute(){
//这里可以加放一个或多个要测试运行时间的方法
TestObject.testMethod();
}
});
}