首先Netbeans 需要structs 2的插件,插件下载地址:https://dl.getdropbox.com/u/201666/nbstruts2.tar.bz2
安装插件:
运行NB6.8-->Tools-->Plugins-->Downloaded-->Add Plugins...-->添加解压后的2个nbm文件-->Install.
新建web工程,在几次next后有个example,可以测试structs框架运行是否正确。HelloWorld项目。
新建完项目后,运行发现错误。
经过调试,错误为web.xml中
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
这个前面的org没加,添加后能在框架下正常运行。
structs.xml要放在源包下的缺省包下。