问答详情
源自:3-1 Action、Service、Dao的创建及配置

请求是怎么提交给departmentAction_findAll.action的

程序是怎么找到departmentAction类的findAll方法的?

提问者:宝慕林3911287 2018-04-19 21:19

个回答

  • 慕数据3377403
    2018-06-03 11:49:25

    请问,这种请求跟哪个包有关系吗?我的代码全都对了,但就是报404错误,错误显示没有映射动作

  • 小蜜蜂飞飞
    2018-04-25 09:37:45

    所有的请求都会被struts过滤,到struts.xml中找到名字为“departmentAction_findAll”的action.我们actiond一般使用通配符配置<action name="departmentAction_*" class="action类的全路径" method="{1}">.这个action满足所有“departmentAction_*”请求,*为该action类中的方法。所以“departmentAction_findAll”可以进入departmentAction类找到findAll方法