1.我的原有配置

jsp表单提交路径

<form class="layui-form" id="form" action="${ctx }/membersLogin/membersLoginAction!membersLogin.action">
............
</form>

struts2拦截配置

    <package name="default" extends="struts-default" namespace="/membersLogin" strict-method-invocation="false">
<action name="membersLoginAction" class="seventykg.web.MembersLoginAction">
<result name="login_success">/index.jsp</result>
<result name="login_fail">/login_fail.jsp</result>
</action>
</package>

2.按常理来说是没问题的

但是每次提交表单的时候报错如下:

There is no Action mapped for namespace。。。。。。。。。

3.百度搜了一下各种解决方法,都不是我想要的,无奈自己看了一下struts.xml配置文件,发现有一个地方叫:

    <!-- 是否开启动态方法调用 -->
<constant name="struts.enable.DynamicMethodInvocation" value="true"/>

当这个value="false"的时候,是不支持(${ctx }/membersLogin/membersLoginAction!membersLogin.action)这样带有方法(membersLogin)的路径的,仅仅支持(${ctx }/membersLogin/membersLoginAction)这样的,方法的话需要写到配置文件中

<package name="default" extends="struts-default" namespace="/membersLogin" strict-method-invocation="false">
<action name="membersLoginAction" class="membersLoginAction" method="membersLogin">
<result name="login_success">/index.jsp</result>
<result name="login_fail">/login_fail.jsp</result>
</action>
</package>

改成true即可解决问题

=====================================================================================

今天特来补充一下还是这个异常问题:

在同一个struts配置文件中,package标签的name属性不能全为default,若有多个,必须给name起名字,若不然还是会报这个异常:

There is no Action mapped for namespace [/membersLogin] and action name [membersLoginAction] associated with context path...

QQ交流群4060038

Struts2中There is no Action mapped for namespace错误解决方法的更多相关文章

  1. eclipse中配置struts2出现There is no Action mapped for namespace [/] and action name [Login] associated wi

    下午在eclipse中配置struts2时报: There is no Action mapped for namespace [/] and action name [Login] associat ...

  2. macOS 中使用 phpize 动态添加 PHP 扩展的错误解决方法

    使用 phpize 动态添加 PHP 扩展是开发中经常需要做的事情,但是在 macOS 中,首次使用该功能必然会碰到一些错误,本文列出了这些错误的解决方法. 问题一: 执行 phpize 报错如下: ...

  3. Struts2中there is no action mapped for acion name (/XXXXX)

    这里的问题出在配置struts.xml中,去掉配置中 namespace="/"属性 即可解决.不同的调用action的方式对namespace="/"属性有的 ...

  4. exe4j中"this executable was created with an evaluation错误解决方法

    在使用exe4j时,如果您的exe4j没有注册,在运行有exe4j转换的*.jar为*.exe的可执行文件是会提示:"this executable was created with an ...

  5. Eclipse中安装git后pull远程仓库出现错误解决方法

    该图中位置为false 在配置文件中添加如下语句 -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2

  6. Eclipse中项目红叉但找不到错误解决方法

    首先windows-show view-problems 根据地址查找错误 若提示: Description    Resource    Path    Location    TypeJava c ...

  7. jquery中Uncaught TypeError: $(...).ajaxUpload is not a function(…)错误解决方法

    错误原因:该函数不是jquery的核心函数,所以需要外部引入ajaxfileupload.js文件,可能是没有引入,或者引入的js文件互相冲突 解决方法:每次进入一个函数之前打印该函数所有的js文件, ...

  8. struts2中错误There is no Action mapped for namespace [/] and action name [] associated with context path

    1 There is no Action mapped for namespace [/] and action name [] associated with context path [/Stru ...

  9. Struts2中关于"There is no Action mapped for namespace / and action name"的总结

    今天在调试一个基础的Struts2框架小程序.总是提示"There is no Action mapped for namespace / and action name"的错误. ...

随机推荐

  1. JDK线程池框架Executor源码阅读

    Executor框架 Executor ExecutorService AbstractExecutorService ThreadPoolExecutor ThreadPoolExecutor继承A ...

  2. memmove和memcpy函数的区别及实现

    一.memmove()和memcpy()函数和strcpy()函数的区别: (1)使用的类型不同,strcpy()函数只对字符串进行操作:memmove()和memcpy()函数对所有类型都适用,为内 ...

  3. TCP/IP学习笔记9--以太网之基本概念1: 分类,连接方式

    时间是变化的财富.时钟模仿它,却只有变化而无财富. -- 泰戈尔 以太网(Ethernet)一词源于Ether(以太), 是介质的意思.在爱因斯坦哥们提出量子力学之前,人们普遍认为宇宙空间充满以太,并 ...

  4. MATLAB 求一个点周围 voronoi 边的顶点的坐标

    本代码在[MATLAB 2015b] 下编写运行成功,不保证所有版本适用. x=[0 -.5 1 1 -1]; y=[0 -1 -.5 1 1]; voronoi(x,y);axis([-2 2 -2 ...

  5. 04 IO流(二)——IO类的记忆方法、使用场景

    关于IO流以前写的PPT式笔记请跳转:https://blog.csdn.net/SCORPICAT/article/details/87975094#262___1451 IO流的主要结构 记忆方法 ...

  6. Go语言学习笔记(9)——接口类型

    接口 Go 语言提供了另外一种数据类型即接口,它把所有的具有共性的方法定义在一起,任何其他类型只要实现了这些方法就是实现了这个接口. /* 定义接口 */ type interface_name in ...

  7. Luogu5280 [ZJOI2019] 线段树 【线段树】

    题目分析: 这题除了分类讨论就没啥了... 容易发现问题实际就是所有操作选和不选按顺序执行的所有答案和.考虑每个点在多少种情况下会有tag. 那么,考虑新插入一个[l,r],所有有交集的点都会被清空, ...

  8. VMWare打开centos,提示内部错误

    如题,VMWare打开centos,提示内部错误.该原因是因为服务被停止了之后没有将其启动,将其启动就解决了. CMD客户端输入命令 services.msc 将关于VM的服务启动就可以了

  9. php-获取某个文件夹下面的文件数量

    /** * 获取文件夹下文件的数量 * @param $url 传入一个url如:/apps/web * @return int 返回文件数量 */ public function getFileNu ...

  10. intellij idea 中右键项目没有git

    1.没有GIT选项说明还没有关联你的仓库 2.ctrl + alt +s 打开VersionControl添加git仓库 3.添加后再次查看,GIT就出现了 4.可以查看历史版本了. 原文地址:htt ...