報(bào)錯(cuò)信息HTTP Status 500 - Unable to instantiate Action, org.ssh.product.action.ProductAction, defined for 'product_save' in namespace '/'org.ssh.product.action.ProductAction我的模型是package?org.ssh.product.action;
……
@Controller??//將這個(gè)action交給spring管理
@Scope("prototype")?//作用域?為多實(shí)例
public?class?ProductAction?extends?ActionSupport?{
……我的struts.xml是???<package?name="product"?extends="struts-default"?namespace="/"??strict-method-invocation="false">
????????<!--?保存商品?-->
????????<action?name="product_save"?class="org.ssh.product.action.ProductAction"?method="{1}Product">
????????????<result>WEB-INF/view/index.jsp</result>
????????????<result?name="input">WEB-INF/view/index.jsp</result>
????????</action>
????</package>我的spring 開(kāi)啟自動(dòng)掃描了<context:component-scan?base-package="org.ssh.*"/>我的web.xml????<!--?配置Struts2過(guò)濾器?-->
????<filter>
????????<filter-name>struts2</filter-name>
????????<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
????</filter>
????<filter-mapping>
????????<filter-name>struts2</filter-name>
????????<url-pattern>/*</url-pattern>
????</filter-mapping>
?????
????<!--?配置Spring的監(jiān)聽(tīng)器?-->
????<listener>
????????<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
????</listener>
????<!--?指定Spring配置文件所在路徑?-->
????<context-param>
????????<param-name>contextConfigLocation</param-name>
????????<param-value>classpath:applicationContext.xml</param-value>
????</context-param>
Struts2 HTTP Status 500 - Unable to instantiate Action
T王者歸來(lái)
2017-08-10 16:46:42