关于 struts2 Unable to load configuration.

来源:互联网 发布:真实二手房源 知乎 编辑:程序博客网 时间:2024/05/17 23:46
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"><struts><package name="student" namespace="/student" extends="struts-default,json-default"><action name="student_*" class="cn.edu.nwsuaf.action.StudentAction"method="{1}"><result name="init">/pages/student/student-edit.jsp</result><result name="update">/pages/student/student-list.jsp</result><result name="find">/pages/student/student-list.jsp</result><result name="delete">/pages/student/student-list.jsp</result><result name="add" type="json"><param name="root">studentAdd</param></result></action></package></struts>    

因为没有继承json-default,导致再加入result type="json"属性时,启动tomcat控制台报错:Exception starting filter struts2 Unable to load configuration. - action

解决方法:

package extends要继承json-default

原创粉丝点击