Struts 生成 xml文件出错 ??
我的问题是这样的:
我下面的生成xml文件段代码在含有main(String[] args)方法的类中运行正常,
而同样的代码在Test继承Action 类中不能运行,运行时却报错误.错误如下
jdom版本1.0 ; struts版本1.1
----生成xml文件代码部分---
try {
Element rootElement = new Element("PantheonMessage");
Document myDocument = new Document(rootElement);
Element childElement0 = new Element("PantheonTransport");
childElement0.setText("内容");
rootElement.addContent(childElement0);
XMLOutputter outputter = new XMLOutputter();
outputter.output(myDocument, new FileWriter("D:/test.xml")
} catch (IOException e) {
System.out.println("make xml error");
}
----在Test继承Action 类运行所报错误部分--
Error 500: (class: com/app/action/xml/MakeXMLAction, method: execute signature: (Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;) Incompatible argumen
---------------
本人困惑两天了,这到底是何种原因呢?谢谢你的指教!