日期:2014-05-17  浏览次数:20610 次

struts2 命名空间问题
struts.xml 简单的全局拦截器配置,权限控制。

@SuppressWarnings("serial")
@Results( { @Result(name = "addCusInit", location = "addCusInit.jsp"),
@Result(name = "addCus", location = "addCus.jsp"),
@Result(name = "fail", location = "fail.jsp"),
@Result(name = "cusInfo", location = "cusInfo.jsp"),
@Result(name = "dealCus", location = "dealCus.jsp"),
@Result(name = "updateCus", location = "updateCus.jsp"),
@Result(name = "cusListDept", location = "cusListDept.jsp"),
@Result(name = "cusListReceive", location = "cusListReceive.jsp"),
@Result(name = "cusListSelf", location = "cusListSelf.jsp") })
@ResultPath("/page/cus")
@ParentPackage("netgrid")
public class CusResponseAction extends ActionSupport {

action里面的注解。

我不解的是,访问的时候的路径,很奇怪 cus-response!getCusReceive,求解释!。。。

------解决方案--------------------
传说中的0配置SSH整合!cus-response!getCusReceive的意思是cus-response这个ACTION的getCusReceive方法
------解决方案--------------------
这是一种动态调用。
假如配置如下
<action name="CusResponseAction" class="com.test.LoginAction" method="excute">
这样会默认调用的是CusResponseAction的excute方法。

当地址栏里输入cus-response!getCusReceive时将调用getCusReceive方法了;而不用去改struts.xml配置文件,即不用把上面的改为method="getCusReceive"