webname=sdfsd
url=http://www.miit.gov.cn/n11293472/n112...
textTag=text_font
dateTag=main-lm2
classOrId=class
url2=http://www.miit.gov.cn/
以上是我保存后 文本里的内容。。第二行后面杯具了
关键的代码如下,用的是properties的list(PrintStream):
PrintStream ps = new PrintStream(new File("F:\temp\"+im.getWebName()+".properties"));
pro.list(ps);
ps.flush();
ps.close();
求高手解释
看源码就知道了
[code="java"]
public void list(PrintStream out) {
out.println("-- listing properties --");
Hashtable h = new Hashtable();
enumerate(h);
for (Enumeration e = h.keys() ; e.hasMoreElements() ;) {
String key = (String)e.nextElement();
String val = (String)h.get(key);
if (val.length() > 40) {
val = val.substring(0, 37) + "...";
}
out.println(key + "=" + val);
}
}
[/code]
val = val.substring(0, 37) + "...";
长度超过40就变成...
哥们,这个肯定不是properties问题,肯定是你取url地址时就已经是带省略号的,你是不是取得是 连接里面的?