總是跳到/error.jsp頁面
我是接著上章的內(nèi)容寫的,沒有開新的項(xiàng)目工程
struts里用的引用其他的配置文件,點(diǎn)擊鏈接總是跳轉(zhuǎn)到/error.jsp頁面
<?xml?version="1.0"?encoding="UTF-8"?> <!DOCTYPE?struts?PUBLIC ????????"-//Apache?Software?Foundation//DTD?Struts?Configuration?2.3//EN" ????????"http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <include?file="helloworld.xml"></include> <package?name="default"?namespace="/"?extends="struts-default"> <!--?注冊攔截器?--> <interceptors> <interceptor?name="mytime"?class="com.imooc.timer.TimerInterceptor"></interceptor> </interceptors> <action?name="timer"?class="com.imooc.timer.TimeAction"> <result>/succes.jsp</result> <!--?引用攔截器?--> <interceptor-ref?name="mytime"></interceptor-ref> </action> </package> </struts>
<!-- helloworld.xml --> <?xml?version="1.0"?encoding="UTF-8"?> <!DOCTYPE?struts?PUBLIC ????????"-//Apache?Software?Foundation//DTD?Struts?Configuration?2.3//EN" ????????"http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <!--?<constant?name="struts.action.extension"?value="html"></constant>?--> <package?name="default"?namespace="/"?extends="struts-default"> <default-action-ref?name="error"></default-action-ref> <action?name="error"> <result?>/error.jsp</result> </action> <action?name="helloworld_*"?method="{1}"?class="com.imooc.action.HelloWorld"> <result>/result.jsp</result> <result?name="add">/{1}.jsp</result> </action> <action?name="loginaction"?method="login"?class="com.imooc.action.LoginAction"> <result>/succes.jsp</result> <result?name="input">login.jsp</result> </action> </package> </struts>
2016-07-11
?<default-action-ref?name="error"></default-action-ref>
????????<action?name="error">
????????????<result?>/error.jsp</result>
????????</action>
你這里設(shè)的默認(rèn)的就是錯誤的頁面