java.util.Enumeration enum = hasht.keys();
while(enum.hasMoreElements()){
…………
your Code
…………
}
while(enum.hasMoreElements()){
…………
your Code
…………
}
解决方案 »
- 问一个关于在jsp页面中使用structs 2 标签的问题
- struts2 Action怎么样只执行dao中的方法后结束 不影响页面
- 有谁有 JSP文件管理论文给发一个好吗 急用谢谢
- 在jsp中怎么实现将dbf数据导入oracle
- 请教:如何在退出系统时,清除IE中的历史记录
- struts中输出Form数组,如何保存数据?
- [求助]关于EL的问题??
- 为什么我的"import Javax.Servlet.http.*;"not exist?????
- 关于写程序建库的问题
- 我修改完jsp页面,放在root(tomcat)下,在浏览器端不能看到变化,怎样去掉缓存,不能每次都要删掉work目录吧。
- 简单的JSP变量语法问题!!!!!!!!
- 一个关于 javax.servlet.http.* 的简单问题
在while循环里
用enum.nextElement();取出hashtable的key
在用hasht.get(key),取出和key对应的值
那么:
在while里
String num=enum.nextElement();
此时 num为1或者num为2
{
System.out.println(bb.nextElement()+": "+(强制类型转换)ee.nextElement());
}
while(enum.hasMoreElements())
{
String tempId = null;
String tempName = null;
tempId = (String)enum.nextElement();
tempName = (String)hasht.get(tempWsId);
}这样对么?怎么出错呀!
tempDes = rs.getString("des");
hasht.put(tempId,tempDes);
java.util.Enumeration enum = hasht.keys();
while(enum.hasMoreElements())
{
int tempId = 0;
String tempName = null;
tempId = (String)enum.nextElement();
tempName = (String)hasht.get(new Integer(tempId));
}
tempId = (String)enum.nextElement();
--->
tempId = ((Integer)enum.nextElement()).intValue();