struts使用json返回类型是报找不到action的错
struts配置文件:
<package name="resourse" extends="
json-default" >
<action name="
addResourse" class="uploadResourseAction">
<result type="json">
</result>
</action>
</package>
action类:
@Component("
uploadResourseAction")@Scope("prototype")
public class UploadResourseAction extends ActionSupport implements SessionAware {
private UploadResourseService uploadResourseService;
private List<ResourseCategory> resourseCategories;
private List<ResourseForum> resourseForums;
private List<ResourseType> resourseTypes;
private ResourseCategory resourseCategory;
private ResourseList resourseList;
//获取资源类型,所属分类
public String showResourseAllType(){
resourseCategories = uploadResourseService.getResourseCategories();
resourseForums = uploadResourseService.getResourseForums(resourseCategory);
resourseTypes = uploadResourseService.getResourseTypes();
return "success";
}
jsp页面:
function upRecource(){
document.getElementById("fistNumFrom").action="
addResourse!showResourseAllType"; document.getElementById("fistNumFrom").submit();
}
运行报的错误信息:
Struts has detected an unhandled exception:
Messages: There is no Action mapped for namespace [/] and action name [addResourse] associated with context path [/ipfcs].
--------------------------------------------
Stacktraces
There is no Action mapped for namespace [/] and action name [addResourse] associated with context path [/ipfcs]. - [unknown location]
求各位大虾帮帮忙
------解决方案--------------------