`
nqp_java
  • 浏览: 78330 次
  • 性别: Icon_minigender_2
  • 来自: 深圳
社区版块
存档分类
最新评论

警告:No configuration found for the specified action

阅读更多

Struts2配置有命名空间的Action时,前台<s:form > 中需要加入命名空间属性 namespace,这个属性的值与struts2配置中的空间名要一至

<!--struts2配置-->
   
 <package name="admin" namespace="/admin"  extends="struts-default"> 

     <action name="myLogin" class="admin.action.LoginAction"> 

         <result name="input">/index.jsp</result> 

         <result name="success">/welcome.jsp</result> 

     </action> 

 </package> 
   

 <!--前台-->      

 <s:form  action="myLogin" method="post" namespace="/admin"  > 

 <s:textfield name="username" label="用户名"></s:textfield> 

 <s:textfield name="password" label="密码"></s:textfield> 

 <s:submit label="登录"></s:submit> 

 </s:form> 

 

如果你不是使用的struts2的标签,而是使用的传统的html代码,则表单的action属性必须加上完整的路径和后缀

也就是说,必须改成如下代码:

<form name="form" method="post" action="/admin/login.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