在myeclipse下
pagefield = dc.createElement("Field");
pagefield.setAttribute("Name", "glDate");
pagefield.setAttribute("type", "Date");
pagefield.setTextContent(glDate);
pagefield.setTextContent(glDate);
这行代码编译报错,提示
the method getTextContent() is undefined for the type Element
原因:
应该使用jdk的rt.jar,
却使用了xml-apis.jar的。
解决方法:
右键项目,java build path,order and export,调整jdk在webAppLibrary的前面,重新编译后完事。