为了账号安全,请及时绑定邮箱和手机立即绑定

为什么我找不到action是500错误。。。

HTTP Status 500 - Unable to instantiate Action, com.imooc.Action.HelloWorlsddAction, defined for 'HelloWorlsdd' in namespace '/'com.imooc.Action.HelloWorlsddAction

type Exception report

message Unable to instantiate Action, com.imooc.Action.HelloWorlsddAction, defined for 'HelloWorlsdd' in namespace '/'com.imooc.Action.HelloWorlsddAction

description The server encountered an internal error that prevented it from fulfilling this request.

exception

Unable to instantiate Action, com.imooc.Action.HelloWorlsddAction,  defined for 'HelloWorlsdd' in namespace '/'com.imooc.Action.HelloWorlsddAction
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:319)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:400)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:501)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)


root cause

<?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>

    <package name="default"  extends="struts-default" namespace="/">

         <default-action-ref name="index"></default-action-ref>

         <action name="index" >

          <result>/error.jsp</result>

         </action>

         

         <action name="*_*" method="{2}" class="com.imooc.Action.{1}Action">

          <result>/result.jsp</result>

          <result name="add">/{2}.jsp</result>

          <result name="update">/{2}.jsp</result>

     </action>

        

        

 </package>

</struts>


正在回答

1 回答

把包名也写成通配符替换就可以了

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

为什么我找不到action是500错误。。。

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信