`
xiang37
  • 浏览: 428240 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

解决:No configuration found for the specified action

阅读更多

正确的做法:

 

 

 

<s:form action="hello" method="post" namespace="/xiva" name="hello">
    	<s:label>输入内容:</s:label><s:textfield name="msg"></s:textfield>
    	<s:submit value="submit"></s:submit>
   	</s:form>

 

 

 

	<package name="demo" namespace="/xiva" extends="struts-default">
		<action name="hello" class="org.xiva.struts2.demo.HelloAction">
			<result name="suc">/hello.jsp</result>
			<result name="fal">/errors.jsp</result>
		</action>
	</package>

 

错误的不给出了,主要是对namespace的处理,改完xml重启即可。

 

extends------->struts-default;来源于struts2的核心包!

action中的method属性,指明使用哪一个方法!

package中的abstract属性为true时,表示该包只能被继承,而没有action的实现!

 

对于action可以采用method匹配的方式!

 

<action name="reg_*" class="org.xiva.struts2.demo.bean.Register" method="{1}">
			<result name="success">/WEB-INF/mess/message.jsp</result>
			<result name="error" type="redirect">/errors.jsp</result>
		</action>	
 
分享到:
评论

相关推荐

    struts2开发遇到的问题

    2. **警告:No configuration found for the specified action: 'sum.action' in namespace: ''** 这个警告通常是因为Struts2找不到指定的Action。如果在JSP中使用 `&lt;s:form action=”sum.action”&gt;`,对应的源文件...

    报错 代码 经验

    : No configuration found for the specified action: 'fileUpLoad.action' in namespace: '/manager'. Form action defaulting to 'action' attribute's literal value. ``` **知识点解释:** 1. **问题描述:** ...

    BURNINTEST--硬件检测工具

    - Minor changes to the No operation error watchdog timer for the CD and Hard disk tests. - Minor correction to the Butterfly seek test. - Video playback trace logging increased. Release 5.3 build ...

    Java邮件开发Fundamentals of the JavaMail API

    things like the last mail received and calculate how many are new for you. So, when using the JavaMail API, if you want this type of information, you have to calculate it yourself. IMAP IMAP is a...

    OutlookAttachView v2.73

    o Added option to scan only emails with the specified 'From' and 'To' strings. * Version 1.82 o When adding a folder to scan (with the Add button), the folder path in now delimited with quotes, ...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    is now available for writing (during the writing, the standard grid object TFlexGrid is released, and a user's one is set). - ADD: In the class TFlexGrid added the properties HOffset and VOffset - ...

    Turbo C 2.00[DISK]

    When /P is specified, the EGA palette will be restored each time the screen is swapped. In general, you don't need to use this switch unless your program modifies the EGA palette registers, or ...

    Turbo C 2.01[DISK]

    When /P is specified, the EGA palette will be restored each time the screen is swapped. In general, you don't need to use this switch unless your program modifies the EGA palette registers, or ...

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    For this reason, the functions that handle these actions offer the option of waiting until the action is complete before returning (so-called synchronous operation); although they can be called in an ...

    CE中文版-启点CE过NP中文.exe

    Fixed the found code dialog count size Fixed mono freezing Cheat Engine when it crashes/freezes Additions and changes: Changed the processlist and added an Applications view similar to the ...

    php.ini-development

    Please see the actual settings later in the document for more details as to why ; we recommend these changes in PHP's behavior. ; display_errors ; Default Value: On ; Development Value: On ; ...

Global site tag (gtag.js) - Google Analytics