Struts2_DefaultActionRel_Bug解决方法

struts.xml配置文件如下:
<package name="front" namespace="/" extends="struts-default" >
    <!-- <default-action-ref name="index"/>  --> <!-- bug!!! -->
    <default-action-ref name="index"/>
       <action name="index" class="com.bjsxt.bbs2009.action.CategoryAction" method="list">
       <result>/index.jsp</result>
       </action>
</package>
   

在web.xml中,如
  <welcome-file-list>
<welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

方法一:在web.xml中将index.jsp改成index可解决

方法二:在web.xml中将index.jsp改成test.jsp。这样在项目中找不到test.jsp主页,default-action-ref默认action将起到作用。

猜你喜欢

转载自847104446.iteye.com/blog/2247406