国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
警告:?No?configuration?found?for?the?specified?...
今天首次使用Struts2,配置一切正常,使用常用tag也正常,但是在使用<s:form>標(biāo)記時(shí),發(fā)現(xiàn)控制臺(tái)總是輸出警告信息,

警告信息內(nèi)容如下:

警告: No configuration found for the specified action: 'ShowMessage'in namespace: ''. Form action defaulting to 'action' attribute'sliteral value.
2008-9-6 11:35:47 org.apache.struts2.components.FormevaluateExtraParamsServletRequest
警告: No configuration found for the specified action: 'ShowMessage'in namespace: ''. Form action defaulting to 'action' attribute'sliteral value.

showmsg.jsp代碼如下

<%@ taglib prefix="s" uri="/struts-tags"%>
......
<div>
hello world
<s:form name="ShowMessage" method="post"action="/hello/ShowMessage.action" >
<s:textfield label="user name"name="username"></s:textfield>
<s:submit></s:submit>
</s:form>
</div>
......

struts.xml配置如下:
......
<struts>
<package name="hello" extends="struts-default"namespace="/hello">
<action name="ShowMessage"class="com.historycreator.strutstest.ShowMessage">
<result>/digg/showmsg.jsp</result>
</action>
</package>
</struts>

打開(kāi)showmsg.jsp頁(yè)面時(shí),就出現(xiàn)上述異常。嘗試了各種配置和訪問(wèn)方法,均出現(xiàn)警告。搜索網(wǎng)絡(luò)給出的答案幾乎都說(shuō)把<s:formname="ShowMessage" method="post" action="/hello/ShowMessage.action">中的.action去掉就可以解決了,做了測(cè)試,問(wèn)題仍然沒(méi)有解決。更有人讓把<s:去掉,不用tag,直接寫(xiě)<form>這個(gè)當(dāng)然不會(huì)有問(wèn)題,但是一會(huì)用標(biāo)記,一會(huì)不用,很雜亂,并且不是解決問(wèn)題的根本之道。

解決方法:
經(jīng)過(guò)測(cè)試發(fā)現(xiàn),是沒(méi)有正確使用tag的原因,這種情況下,正確的寫(xiě)法應(yīng)該是,<s:formname="ShowMessage" method="post" action="ShowMessage"namespace="/hello" >


原因分析:

因?yàn)殚_(kāi)始使用的struts2標(biāo)簽(form)并未指定namespace屬性。所以struts2會(huì)默認(rèn)從根命名空間"/"搜索action'/hello/ShowMessage.action',如搜索不到則進(jìn)入默認(rèn)命名空間''搜索action串,在默認(rèn)命名空間中是肯定找不到自己定義的action的,所以,struts2拋出一個(gè)警告信息。
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
Struts2中關(guān)于“There is no Action mapped for namespace / and action name”的總結(jié)
標(biāo)簽package中的namspace的用法
Struts2的配置文件——struts.xml
寶寶Struts2學(xué)習(xí)總結(jié)
struts 2 配置方法及其技巧實(shí)例整理(一)
Struts2中struts.xml的Action配置詳解
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服