<%
Hashtable test1 = new Hashtable();
Hashtable test2 = new Hashtable();
Hashtable all = new Hashtable();
test1.put("A","第一列");
test1.put("B","第二列");
all.put("FIRST",test1);
test2.put("1","No1");
test2.put("2","No2");
test2.put("3","No3");
all.put("SECOND",test2);
out.println("all.size = "+all.size()+"<br>");
Hashtable check = (Hashtable)all.get("FIRST");
out.println("first.size = "+check.size()+"<br>");
Hashtable check1 = (Hashtable)all.get("SECOND");
out.println("second.size = "+check1.size()+"<br>");
%>
运行结果应该是all.size = 2
first.size = 2
second.size = 3我想问题出在test1上,有可能都指向test1,才得出
all.size = 2
first.size = 3
second.size = 3
Hashtable test1 = new Hashtable();
Hashtable test2 = new Hashtable();
Hashtable all = new Hashtable();
test1.put("A","第一列");
test1.put("B","第二列");
all.put("FIRST",test1);
test2.put("1","No1");
test2.put("2","No2");
test2.put("3","No3");
all.put("SECOND",test2);
out.println("all.size = "+all.size()+"<br>");
Hashtable check = (Hashtable)all.get("FIRST");
out.println("first.size = "+check.size()+"<br>");
Hashtable check1 = (Hashtable)all.get("SECOND");
out.println("second.size = "+check1.size()+"<br>");
%>
运行结果应该是all.size = 2
first.size = 2
second.size = 3我想问题出在test1上,有可能都指向test1,才得出
all.size = 2
first.size = 3
second.size = 3
解决方案 »
- 对于比较常用且固定的数据,比如:商品的分类,为了避免反复在数据库读取,有什么比较好的解决方案
- JSP 点击提交按钮后,会自动将原来文本框内容清空
- javax.servlet.ServletException: Could not resolve view with name 'Success' in se
- jsp 中类的使用 问题
- 打开myeclipse出现问题
- TOMCAT 疑问
- 全分压上,求解SESSION中出现的极度奇怪的问题!高手进~~
- jsp中连接oracle数据库的问题
- 自己建的包看不见啊!求救!!
- 在线:JAVAMAIL发送邮件给多个收件人
- <div>是什么意思
- 发送Mail时如何通过服务器的身份验证?(非JavaMail方式)
会清除所有内容
Hashtable test1 = null ;
Hashtable all = new Hashtable();
test1 = new Hashtable() ;
test1.put("A","第一列");
test1.put("B","第二列");
all.put("FIRST",test1);
test1 = new Hashtable() ;
test1.put("1","No1");
test1.put("2","No2");
test1.put("3","No3");
all.put("SECOND",test1);
out.println("all.size = "+all.size()+"<br>");
Hashtable check = (Hashtable)all.get("FIRST");
out.println("first.size = "+check.size()+"<br>");
Hashtable check1 = (Hashtable)all.get("SECOND");
out.println("second.size = "+check1.size()+"<br>");
%>