测试application和request:
1.包:
package ScopeTest;
/**
*
* @author lucifer
*/
public class TestScope {
private int i;
public TestScope(){
i = 0;
}
public int getNextInt(){
return ++i;
}
}
2.JSP代码:
Document : TestScope
Created on : 2009-10-3, 14:29:18
Author : lucifer
--%>
/p>
"http://www.w3.org/TR/html4/loose.dtd">
JSP PageApplication Scope:
Request Scope:
3.输出:
Application Scope: 1
Request Scope:
1
按下按钮后输出:
Application Scope: 2
Request Scope:
1