第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

程序員小白的提問 +__+、:struts+spring配置問題

程序員小白的提問 +__+、:struts+spring配置問題

熊貓程序員 2017-03-30 12:20:27
案例目錄spring.xml配置<!-- dispartchAction配置 --><bean id="dispartchAction" class="sshDemo1.action.DispatchAction"scope="prototype"></bean><!-- userAction配置 --><bean id="userAction" class="sshDemo1.action.UserAction"scope="prototype"></bean>struts配置<struts>?<constant name="struts.i18n.encoding" value="UTF-8"></constant>?<constant name="struts.action.extension" value="html"></constant>?<constant name="struts.enable.DynamicMethodInvocation" value="false"></constant>?<package name="packageDemo1" extends="struts-default" namespace="/">?<!-- 注意:在struts2.3以后使用通配符配置需要將struts.enable.DynamicMethodInvocation=false? ? ? ? ? 同時(shí),在package下配置global-allowed-methods或配置在action下配置allowed-methods? ?-->? <global-allowed-methods>login,index</global-allowed-methods>? <action name="dispartchAction_*" class="dispartchAction" method="{1}">? ?<result name="index">/WEB-INF/index.jsp</result>? ?<result name="login">/WEB-INF/login.jsp</result>? </action>? <action name="userAction_*" class="userAction" method="{1}">? ?<result name="success">/WEB-INF/success.jsp</result>? ?<result name="login">/WEB-INF/login.jsp</result>? </action>?</package></struts>web.xml配置? <context-param>? ?<param-name>contextConfigLocation</param-name>? ?<param-value>classpath:spring.xml</param-value>? </context-param>? <listener>? ?<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>? </listener>? <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>index.jsp頁(yè)面<a href="${pageContext.request.contextPath}/dispartchAction_login.html">登錄</a>login.jsp頁(yè)面 <form action="${pageContext.request.contextPath}/userAction_login.html" method="post">當(dāng)訪問index.jsp和在index.jsp跳轉(zhuǎn)到login.jsp的時(shí)候,程序沒有錯(cuò)誤,但是當(dāng)?shù)卿浽L問userAction的時(shí)候報(bào)錯(cuò),說找不到userAction對(duì)象。HTTP Status 500 - Unable to instantiate Action, userAction, defined for 'userAction_login' in namespace '/'Cannot find class [sshDemo1.action.UserAction] for bean with name 'userAction' defined in class path resource [spring.xml]; nested exception is java.lang.ClassNotFoundException: sshDemo1.action.UserAction求解?謝謝?。?!。。。。
查看完整描述

3 回答

已采納
?
你的女友漏氣了

TA貢獻(xiàn)3條經(jīng)驗(yàn) 獲得超0個(gè)贊

錯(cuò)誤信息寫的清清楚楚啊

查看完整回答
反對(duì) 回復(fù) 2017-03-31
  • 熊貓程序員
    熊貓程序員
    我看那錯(cuò)誤應(yīng)該是找不到userAction這個(gè)類對(duì)象,但是我在spring.xml中配置了這個(gè)類 <!-- userAction配置 --> <bean id="userAction" class="sshDemo1.action.UserAction" scope="prototype"></bean> 我訪問dispartchAction的時(shí)候可以訪問,也就說明加載到了配置文件spring,但是當(dāng)點(diǎn)擊登陸,表單提交找userAction的時(shí)候就報(bào)錯(cuò),我就感覺和差異,我覺得是spring.xml文件沒有創(chuàng)建到這個(gè)對(duì)象,所以報(bào)錯(cuò)。但是為什么前面的能夠找到dispathAction,后面userAction的找不到。
?
younghu

TA貢獻(xiàn)25條經(jīng)驗(yàn) 獲得超6個(gè)贊

你form表單action 寫錯(cuò)了吧。不是xx.action嗎
查看完整回答
反對(duì) 回復(fù) 2017-04-01
?
熊貓程序員

TA貢獻(xiàn)7條經(jīng)驗(yàn) 獲得超0個(gè)贊

我剛剛認(rèn)真看了一遍,將改了一下dispartchAction-->dispatchAction然后將服務(wù)器clear了一下,然后從新啟動(dòng)了一下,就可以了#_#,具體情況我覺得可能是服務(wù)器緩存了數(shù)據(jù)沒有更新,但是昨天確實(shí)是重啟服務(wù)器了,就是不行。哎~,真心累,。。。。。。。。

查看完整回答
反對(duì) 回復(fù) 2017-03-31
  • 3 回答
  • 0 關(guān)注
  • 2305 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)