java struts2 debug

來源:互聯網
上載者:User

標籤:name   大寫   參數   sof   end   ext   div   utf-8   idt   

出了一堆bug 改的順序和哪個起了作用不太記得了

下面列出遇到問題的順序:1java.lang.NoSuchMethodException:沒這個方法

代碼是改正後的,出錯的時候保證class ,action name, method都沒拼錯,找了很久,做了將package name 由default變為放action的包action中且出現此錯誤的時候namespace="/" 並沒有,後來加的不知道會在哪個錯誤起作用

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"><struts><package name="action" namespace="/" extends="struts-default"><action name="QUERY1" class="action.libraryaction" method="query1"><result>/result.jsp</result></action><action name="QUERY2" class="action.libraryaction" method="query2">  <result name="success">/result.jsp</result></action>  <action name="QUERY3" class="action.libraryaction" method="query3">  <result name="success">/result.jsp</result></action>  </package></struts>

 Struts2 There is no Action mapped for namespace [/] and action name [xxxx] associated with context path [/xxxxx]

struts.xml自己位置飛了不在src下了,改回去好使了

 

Could not find action or result: /項目名/action名?參數=參數   這個錯誤是原先第一個action的result 用的大寫的SUCCESS 改為小寫就好了

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"><struts><package name="action" namespace="/" extends="struts-default"><action name="QUERY1" class="action.libraryaction" method="query1"><result>/result.jsp</result></action><action name="QUERY2" class="action.libraryaction" method="query2">  <result name="success">/result.jsp</result></action>  <action name="QUERY3" class="action.libraryaction" method="query3">  <result name="success">/result.jsp</result></action>  </package></struts>

 

java struts2 debug

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.