どのように私はこれを書くことができます:
<context:annotation-config/>
<context:component-scan base-package="com.generator"/>
jdom2を使用。私が試した:
beans.addContent(new Element("context:annotation-config")); beans.addContent(new Element("context:component-scan").setAttribute("base-package","com."+getProjectName()))
しかし、私はこのエラーがありました:
「context:annotation-config」という名前は、JDOM/XML 要素には使用できません。XML 名「context:annotation-config」に文字「:」を含めることはできません。