0
我對將代碼隱藏註釋轉換爲常規struts.xml
文件感到困惑。Struts 2插件轉換 - 從Codebehind到Convention插件
如何識別動作類中的動作名稱?因爲如果寫入方法public String list{}
- 動作與JSP的匹配product-list.jsp
將自動識別頁面,並且URL是product!list
。什麼是傳統插件?
當前網址:
http://localhost:7001/example/product!search
- JSP名稱product-search.jsp
和ProductAction
- 動作類。
請告訴我如何配置struts.xml
文件,它等於上面的配置。
我試圖象下面這樣:
<package name="example" namespace="/" extends="struts-default">
<action name="Search">
<result>product-search.jsp</result>
</action>
</package>
錯誤:
org.apache.struts2.dispatcher.Dispatcher - Could not find action or result
There is no Action mapped for namespace/and action name part. - [unknown location]
請讓我知道如果你不明白這個問題.. – user2444474