Struts2动态调用DMI及错误解决方法
举一个简单的例子——
比如LoginAction中有add,dell方法,则
1、配置struts.xml文件
1
3
4
5
6
2、在 loginAction中 编写add方法和dell方法:
public String add()
{
return “add”;
}
public String dell()
{
return “dell”;
}
3、链接中使用!动态调用所需方法:
常见错误:
There is no Action mapped for namespace [/XXX] and action name [xxx!xxx] associated with context path [/xxx_method].
解决方法:
默认的Struts.xml中是这样的
这样我们在地址栏输入感叹号动态调用方法的时候会出错,我们只需更改这一句即可
struts2文件上传(保存为BLOB格式) http://www.linuxidc.com/Linux/2014-06/102905.htm
Struts2的入门实例 http://www.linuxidc.com/Linux/2013-05/84618.htm
Struts2实现ModelDriven接口 http://www.linuxidc.com/Linux/2014-04/99466.htm
遇到的Struts2文件下载乱码问题 http://www.linuxidc.com/Linux/2014-03/98990.htm
Struts2整合Spring方法及原理 http://www.linuxidc.com/Linux/2013-12/93692.htm
Struts2 注解模式的几个知识点 http://www.linuxidc.com/Linux/2013-06/85830.htm