一个很怪的问题。
控制台异常:
[org.apache.struts2.dispatcher.Dispatcher]-[WARN] Could not find action or result
There is no Action mapped for namespace /jsp/schedule and action name addMynoteAction. - [unknown location]
这是struts.xml文件Action的配置:
<!-- 查询我的便签列表 -->
<action name="findMynoteListAction" class="mynoteAction" method="findMynoteList">
<result name="success" >/jsp/schedule/myNoteList.jsp</result>
</action>
<!-- 添加便签【只有这个Action找不到】 -->
<action name="addMynoteAction" class="mynoteAction" method="addMynote">
<result type="redirectAction">findMynoteListAction</result>
<result name="input">/jsp/schedule/myNoteAdd.jsp</result>
</action>
<!-- 删除便签 -->
<action name="deleteMynoteAction" class="mynoteAction" method="deleteMynote">
<result type="redirectAction" >findMynoteListAction</result>
</action>
<!-- 根据ID查询便签 -->
<action name="findMynoteByIdAction" class="mynoteAction" method="findMynoteById">
<result name="success" >/jsp/schedule/myNoteUpdate.jsp</result>
<result name="error" type="redirectAction">findMynoteListAction</result>
</action>
<!-- 更新便签 -->
<action name="updateMynoteAction" class="mynoteAction" method="updateMynote">
<result name="success" type="redirectAction">findMynoteListAction</result>
<result name="input" type="redirectAction" >findMynoteByIdAction</result>
</action>
这是struts.xml文件package声明:
<package name="default" extends="struts-default" namespace="/">
这是jsp页面form表单调用Action的代码:用的是绝对路径
<form name="form1" method="post" action="${basepath}addMynoteAction.action">
配置文件中写的都一样,只是name不一样,页面调用的方法都一样,所有页面也在同一个文件夹下,可是根本就找不到调用的这个Action,写的是绝对路径啊,除了增加(addMynoteAction),其他功能都没问题。
我把struts.xml文件中namespace="/"属性去掉后,就不报404错误了,所有功能都实现了,可是。。增加成功返回到列表页面时,图片都显示不出来了。。其他功能删除修改等完成后返回列表图片都正常啊。页面图片用的都是绝对路径。
后来我又把namespace="/"加上,发现别的页面调用这个addMynoteAction都没问题,唯独这个页面调用哪个Action都错误,我又重新建了新页面,忘记了删除jsp页面开头的
<base href="<%=basePath%>">,竟然不报错了,我习惯新建页面后把这句删了,因为以前做项目时,加上这句就
错。
虽然项目不报错了,可是我还是不明白,别的页面、修改查询等页面都没有这句<base href="<%=basePath%>">,我习惯都用绝对路径,可是为什么别的页面没有这句就不报错,唯独这个增加
数据的页面没有这句就报错?这个模块所有页面都在一个文件夹里同一路径下。
分享到:
相关推荐
在Myeclipse 8.5中用外带的tomcat时候,会因为JDK版本的问题出现Could not find the main class,按照上述文档的步骤就可以解决,我亲自体验过
Eclipse 编译时遇到错误could not find the main class,program will exit的解决方法
Could not find module 'D:\codna\Library\bin\geos_c.dll'Could not find module 'D:\codna\Library\bin\geos_c.dll'Could not find module 'D:\codna\Library\bin\geos_c.dll'
NULL 博文链接:https://liuenjian.iteye.com/blog/711927
Could not find Developer Disk Image"问题
百度飞桨遇到的问题,安装cuda不能启动,错误提示importError: Could not find 'cudnn64_7.dll'的解决。将压缩包内的文件对应放入cuda安装位置即可!
【故障解决】OGG-00446 Could not find archived log for sequence.pdf
WIN7下运行Jar文件提示Could not find the main class
xcode Could not find Developer Disk Image 11.4 (15F5061c) 亲测可用 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 记得一定要重启Xcode才生效.
xcode 、could not find developer disk image、真机测试、ipa打包
xcode Could not find Developer Disk Image
解决Xcode在ipad/iphone9.2系统真机测试时出现could not find developer disk image问题,只要拷贝这个文件到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport,然后重新启动...
打包找不到 zkclient COULD NOT FIND zkclient-0.11 解压后将jar包与pom文件都放在.m2\repository指定路径下
打包找不到 jcommander COULD NOT FIND jcommander-1.48 解压后将jar包与pom文件都放在.m2\repository指定路径下
主要介绍了Tensorflow安装问题: Could not find a version that satisfies the requirement tensorflow,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来...
打包找不到 RING-CORES问题 COULD NOT FIND cglib:cglib-2.2.2 解压后将jar包与pom文件都放在.m2\repository指定路径下
打包找不到 stream COULD NOT FIND stream-2.5.2 解压后将jar包与pom文件都放在.m2\repository指定路径下
打包找不到 classworlds问题 COULD NOT FIND classworlds-1.1-alpha-2 解压后将jar包与pom文件都放在.m2\repository指定路径下
NULL 博文链接:https://yintech.iteye.com/blog/374842
【SpringBoot】Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster报错明细问题解决后记 报错明细 IDEA SpringBoot集成hadoop运行环境,,本地启动项目,GET请求接口触发...