同样的代码 在普通类里可以读到 在jsp里就根本连while循环都进不去,但是en又是有值的...我jsp里的代码如下<% CommPortIdentifier portId; Enumeration en = CommPortIdentifier.getPortIdentifiers();
System.out.println(en);
// iterate through the ports.
while (en.hasMoreElements()) {
System.out.print("xxxxxx");
portId = (CommPortIdentifier) en.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
%> <option><% portId.getName();%></option>
<% out.print(11+portId.getName()); }
} %>
System.out.println(en);
// iterate through the ports.
while (en.hasMoreElements()) {
System.out.print("xxxxxx");
portId = (CommPortIdentifier) en.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
%> <option><% portId.getName();%></option>
<% out.print(11+portId.getName()); }
} %>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货