本来想用DMI的方式调用,如 registerAction!add,就能调用registerAction里面的add方法,但说来愚笨,这一个小问题说得很明白,就是找不到相就的Action或是相应的方法,但让我困扰一好几个小时,我的struts.xml中的action配置如下:
<action name="registerAction" class="registerAction">
<result name="success">/success.jsp</result>
<result name="fail">/fail.jsp</result>
</action>
这个不会有什么问题的,这里的 class="registerAction"是说我的Action是由Spring来管理的,如果不是这样话,把Class配置成相对应的类的就可以了。
但是运行会出现异常,说是找不到相应的Action或是方法,小改下,我指定方法还不成吗?
<action name="*" class="registerAction" method="{1}">
<result name="success">/success.jsp</result>
<result name="fail">/fail.jsp</result>
</action>
再访问呢,没有问题,好生怪异了,现在问题应该就在struts.xml中的配置了,在一个不经意的角落里看到要一句:
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
郁闷,原来Copy配置的时候,把这句没有注意,显式的关闭了MDI,所以呢,把这句给去了,改去原来的配置,再访问,好了,世界清静了!
后记:这种问题通常是Struts.xml的配置问题,检查这样的问题,首先看是否关了DMI,二来,看下Action里在配置会不会有相同名称的,可能会冲突。
分享到:
相关推荐
前几天在网上下载一个struts2的helloword的例子,那个作者也真够缺德的,搞个错误的程序,害得我查了一天的程序错误。 最后发现竟然是struts.xml被写成啦sturts.xml。 碰见这样的问题先鄙视下提供例子的作者, ...
HTTP Status 404 - There is no Action mapped for namespace and action name BackMemberGroupAudit..doc
该文档对weblogic使用过程中,包括下载,安装,部署...6. weblogic部署war包action不能访问问题解决方法 [There is no Action mapped for namespace / and action name]. 5 7. java.lang.StackOverflowError. 5 等等
http://localhost:8080/ struts2会拦截,出现异常信息 There is no Action mapped for namespace / and action name.默认配置的welcomefile没有起作用。 按附件配置即可解决此问题
在网上找了好个struts2的例子结果都不好使报There is no Action mapped for namespace / and action name这个错,没办法自己搞了个好用的,myeclipse 6.0 +tomcat5.5 + jdk 1.5 引入项目后直接发布就可以了!
MDB: A Memory-Mapped Database and Backend for OpenLDAP
To reserve or commit memory and unintentionally not release it when it is no longer being used. A process can leak resources such as process memory, pool memory, user and GDI objects, handles, threads...
Memory-Mapped Files for Qualcomm Brew By Ray Rischpater
开发中,我们常常会遇到很多异常报错,现在就我工作中经常遇到的报错做记录和总结,首先对自己会有很大的帮助,同时希望对读者也起到一定的帮助。废话不多说,先上报错。 1. Ambiguous mapping. Cannot map ‘***’ ...
is larger than the largest known FADT version, and 2) if there is a mismatch between a 32-bit block address and the 64-bit X counterpart (when both are non-zero.) Example Code and Data Size: These ...
There is no flow logic, no business logic, and no model information -- just tags. Tags are one of the things that make Struts unique compared to other frameworks like Velocity. Note: "Think thin" ...
基于.NET4.0的MemoryMappedFile实现共享内存通信 共享内存通信可以解决跨线程、跨进程、跨EXE之间通信的问题 对于需要传输图片等引用类数据,可以通过序列化和反序列化配合共享内存实现跨进程(跨EXE)通信 共享...
MemoryMappedFile 使用 C# 内存中分配一大块地址. 前边分配一个用与共同配置用 后边N个结构体 for循环建 一般用到此问题,两本程序 一个读一个写 循环读写 ----2015/09/24 Lyndon 上海----
Fixed comparing against disconnected mapped network drives to prompt for username/password and reconnect.
'disk_image' is a raw hard disk image for IDE hard disk 0 Standard options: -h or -help display this help and exit -version display version information and exit -machine [type=]name[,prop[=value][,.....
For a node's Mapped Rx signal, the assigned value table is displayed in the dialog box in addition to the overview. For user-defined attributes with the type "hex" it is now possible to define the min...
/* It is no longer available */ current_location_mcb->is_available = 0; /* We own it */ memory_location = current_location; /* Leave the loop */ break; } } /* If we made...
When mapping from an ER model to a relational model, a strong entity is mapped into a (a) table (b) row (c) column (d) key Correct answer is (a) 10. Which of the following is true about ...
Indian Subcontinent, India, and there is a strong promotion by the Asian-Pacific Development Information Programme (APDIP) for the use of FOSS in the countries in South East Asia. On the contrary, ...
3. There is a point light and a single directional light in the scene. 4. There is one rotating triangle floating in the air, casting a shadow on the table, walls and other objects. 5. The program ...