问题描述:
<a href="<%=request.getContextPath() %>/rights_main.do?method=addBefore"><font color="red">新增模块</font></a>
我点击这个链接的时候,插入断点,发现没有进入这个action里的addBefore这个方法,也没有报任何错误,请问大哥大姐,有何指点啊?
相关的代码:
Rights_mainAction.java: @SuppressWarnings("unchecked")
public ActionForward addBefore(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) { //显示select下拉框里的内容
List viewList = new ArrayList();
@SuppressWarnings("unused")
List selectList = prvTreeService.searchPrv("0");
viewList.add(new LabelValueBean("*******顶级权限*******","0"));
request.setAttribute("parentid", viewList);
return mapping.findForward("add_rights");
}

struts-config.xml: <action
  attribute="rights_mainForm"
  name="rights_mainForm"
      parameter="method"
      path="/rights_main"
      validate="false"
      type="org.springframework.web.struts.DelegatingActionProxy">
       <forward name="add_rights"  path="/rights/rights_add.jsp"/>
       <forward name="rights_main"  path="/rights/rights_main.jsp"/>  
       <forward name="add_success"  path="/rights_main.do"/>
       <forward name="edit"  path="/rights/rights_edit.jsp"/>
   </action>applicationContext-action.xml:
<bean name="/rights_main" class="org.web.action.Rights_mainAction">
<property name="pageService" ref="pageService"/>
<property name="check" ref="check"/>
<property name="dbService" ref="db2PrivateService"/>
<property name="checkUrlService" ref="checkUrlService"/>
<property name="rightsService" ref="rightsService"/>
<property name="logService" ref="logService"/>
<property name="prvTreeService" ref="prvTreeService"/>
</bean>恳请大哥大姐指点,叩首!

解决方案 »

  1.   

    struts的配置文件好像还要配置一个插件什么的吧?
    其他的也没看出什么问题
      

  2.   

    查看一下struts的配置,应该是哪里有问题
      

  3.   

    换种写法吧。这种写法我没见过。
    要不在strtus的配置文件里声明调用的方法名。
    要不就把访问路径改为问题描述:
    <a href="<%=request.getContextPath() %>/rights_main!addBefore.do">
    希望能帮到你!!
      

  4.   

    哦。。不好意思。难道你的是struts1? 那应该帮不了你了~~!