- 浏览: 5041316 次
- 性别:
- 来自: 南京
文章分类
- 全部博客 (2844)
- java (1094)
- hadoop (37)
- jvm (39)
- hbase (11)
- sql (25)
- 异常 (83)
- div css (6)
- 数据库 (95)
- 有趣的code (15)
- struts2 (6)
- spring (124)
- js (44)
- 算法 (65)
- linux (36)
- hibernate (7)
- 中间件 (78)
- 设计模式 (2)
- 架构 (275)
- 操作系统 (91)
- maven (35)
- tapestry (1)
- mybatis (9)
- MQ (101)
- zookeeper (18)
- 搜索引擎,爬虫 (208)
- 分布式计算 (45)
- c# (7)
- 抓包 (28)
- 开源框架 (45)
- 虚拟化 (12)
- mongodb (15)
- 计算机网络 (2)
- 缓存 (97)
- memcached (6)
- 分布式存储 (13)
- scala (5)
- 分词器 (24)
- spark (104)
- 工具 (23)
- netty (5)
- Mahout (6)
- neo4j (6)
- dubbo (36)
- canal (3)
- Hive (10)
- Vert.x (3)
- docker (115)
- 分布式追踪 (2)
- spring boot (5)
- 微服务 (56)
- 淘客 (5)
- mesos (67)
- php (3)
- etcd (2)
- jenkins (4)
- nginx (7)
- 区块链 (1)
- Kubernetes (92)
- 驾照 (1)
- 深度学习 (15)
- JGroups (1)
- 安全 (5)
- 测试 (16)
- 股票 (1)
- Android (2)
- 房产 (1)
- 运维 (6)
- 网关 (3)
最新评论
-
明兜3号:
部署落地+业务迁移 玩转k8s进阶与企业级实践技能(又名:Ku ...
Kubernetes系统常见运维技巧 -
q328965539:
牛掰啊 资料收集的很全面
HDFS小文件处理解决方案总结+facebook(HayStack) + 淘宝(TFS) -
guichou:
fluent挂载了/var/lib/kubelet/pods目 ...
kubernetes上部署Fluentd+Elasticsearch+kibana日志收集系统 -
xu982604405:
System.setProperty("java.r ...
jmx rmi 穿越防火墙问题及jmxmp的替代方案 -
大漠小帆:
麻烦问下,“获取每个Item相似性最高的前N个Item”,这个 ...
协同过滤推荐算法在MapReduce与Spark上实现对比
在使用<s:form>标记时,发现控制台总是输出警告信息,
警告信息内容如下:
警告: No configuration found for the specified action: 'ShowMessage' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
2008-9-6 11:35:47 org.apache.struts2.components.Form evaluateExtraParamsServletRequest
警告: No configuration found for the specified action: 'ShowMessage' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
showmsg.jsp代码如下
<%@ taglib prefix="s" uri="/struts-tags" %>
......
<div>
hello world
<s:form name="ShowMessage" method="post" action="/hello/ShowMessage.action" >
<s:textfield label="user name" name="username"></s:textfield>
<s:submit></s:submit>
</s:form>
</div>
......
struts.xml配置如下:
......
<struts>
<package name="hello" extends="struts-default" namespace="/hello">
<action name="ShowMessage" class="com.historycreator.strutstest.ShowMessage">
<result>/digg/showmsg.jsp</result>
</action>
</package>
</struts>
打开showmsg.jsp页面时,就出现上述异常。尝试了各种配置和访问方法,均出现警告。搜索网络给出的答案几乎都说把<s:form name="ShowMessage" method="post" action="/hello/ShowMessage.action" >中的.action去掉就可以解决了,做了测试,问题仍然没有解决。更有人让把<s:去掉,不用tag,直接写<form>这个当然不会有问题,但是一会用标记,一会不用,很杂乱,并且不是解决问题的根本之道。
解决方法:
经过测试发现,是没有正确使用tag的原因,这种情况下,正确的写法应该是,<s:form name="ShowMessage" method="post" action="ShowMessage" namespace="/hello" >
原因分析:
因为开始使用的struts2标签(form)并未指定namespace属性。所以struts2会默认从根命名空间"/" 搜索action '/hello/ShowMessage.action',如搜索不到则进入默认命名空间''搜索action串,在默认命名空间中是肯定找不到自己定义的action的,所以,struts2抛出一个警告信息。
现在我们指定了namespace为/hello,则struts2会直接在/hello命名空间寻找。可以想象,如果在这么命名空间里找不到请求的action,也会抛出一条类似的信息。
注意,<s:form name="ShowMessage" method="post" action="ShowMessage" namespace="/hello" >
不能写成<s:form name="ShowMessage" method="post" action="ShowMessage.action" namespace="/hello" >
这样仍然有对应的警告信息,并且提交后出现无法访问的结果。因为没有ShowMessage.action这样一个action,这个.action不能由我们手工添加,Struts2会自动为你完成这个工作,并且手工添加是不行的,就不必多此一举了。但是在其他的场合,比如使用超级链结,则可以加上这个.action。
转载请注明 historycreator.com
发表评论
-
kafka运行过程中localhost.localdomain: 未知的名称或服务
2017-11-22 19:37 2444kafka运行过程中出现了java.net.UnknownH ... -
protocol 实体变动修改报错
2017-09-20 17:10 2438java.lang.IllegalStateExceptio ... -
用 nginx 反代一个域名,域名 dns 变更后 nginx 返回 504
2017-08-23 19:08 1375用域名 www.abc.com 反代 www.abcd.co ... -
Errors occurred during the build. Errors running builder 'Maven Project Builder'
2017-08-06 15:28 2117前几天项目还好好的,今天重装系统导入maven项目,报错,原 ... -
com.dyuproject.protostuff.ProtobufException: Protocol message contained an inval
2017-08-05 22:38 2583log4j:WARN No appenders could ... -
dubbo 接口 序列化问题
2017-06-16 15:29 2650java.lang.ClassNotFoundExcepti ... -
Error starting daemon: layer does not exist
2017-06-02 14:52 3164#systemctl status docker.servi ... -
Spark执行样例报警告:WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any
2017-05-25 10:26 1860搭建Spark环境后,调测Spark样例时,出现下面的错误: ... -
如何解决java.lang.SecurityException: Invalid signature file digest for Manifest main
2017-05-11 16:14 3521<plugin> ... -
k8s 异常
2017-03-02 17:02 1436Error syncing pod, skipping: ... -
docker
2017-02-20 13:36 5291、Error running DeviceCreate ... -
windows 下 shared zone xxx has no equal addresses
2016-11-27 00:23 1671在windows下启动nginx出现错误 shared zo ... -
mvn 运行 jetty
2016-06-30 15:53 2458[ERROR] Failed to execute goal ... -
Communications link failure的解决办法
2016-06-01 10:15 27275使用Connector/J连接MySQL数据库,程序运 ... -
线程池超时异常
2016-05-29 19:58 985public void execute2(){ ... -
maven 版本问题
2016-04-28 17:49 1056<dependency> ... -
maven 打包执行异常
2016-04-04 13:36 916解决: <filters> < ... -
深入JDK源代码之Arrays类中的排序查找算法
2016-03-28 10:55 686java.util.Arrays类。这个类是个数组工具类。主 ... -
spring 事物多线程问题
2015-12-12 18:03 3958Dec 12, 2015 4:46:04 PM com.a ... -
jdk bug
2015-12-12 15:53 802# # If you would like to subm ...
相关推荐
标题中的“tomcat报错Unable to find 'struts multipart saveDir'”是一个常见的问题,通常出现在使用Apache Struts框架,并且在处理multipart/form-data类型的请求时。这种类型的请求通常用于上传文件,而`saveDir`...
Form action defaulting to 'action' attribute's literal value. ``` **知识点解释:** 1. **问题描述:** - 在此例中,Struts框架未能找到指定的`fileUpLoad.action`配置。 - 这可能是因为配置文件中没有为该...
- Added defaulting mechanism for handshake thresholds to avoid errors due to fixed defaults conflicting with driver queue size defaults. - Changed default for sendTimeoutMultiplier for not NT-...
19或许各位有疑问,诶,窝明明固体物理和热统学过啊,如果不计入格点间的非简谐相互作用(即关于位置变化量的3阶项及以上),非谐效应中的热膨胀和热传导是不存在的由于核心思路是通过热流和温度梯度在某段范围内...
SMTP server will relay the message on to the SMTP server of the recipient(s) to eventually be acquired by the user(s) through POP or IMAP. This does not require your SMTP server to be an open relay,...
Idea创建的Maven项目出现警告:No archetype found in remote catalog. Defaulting to internal catalog所需要的文件
chrome_driver_path = "path/to/your/chromedriver" # 创建ChromeDriver对象 driver = webdriver.Chrome(executable_path=chrome_driver_path) ``` 4. 操作浏览器:现在你可以使用`driver`对象来控制Chrome浏览器了...
Select collections with clear goals instead of defaulting to objects or arrays. See how to simplify iterations from complex loops to single line array methods. Master techniques for writing flexible ...
eantruntime' was not set, defaulting to build.sysclasspath=last; set to false fo r repeatable builds BUILD SUCCESSFUL Total time: 0 seconds 3.执行命令: java -jar textclient.jar <username> <port> ...
The design discussions concentrate on how to choose between different approaches to accomplishing something in C++. How do you choose between inheritance and templates? Between templates and generic ...
SLF4J: Failed to load class "org.slf4j.impl....SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
ModernGadgets is a set of sleek, minimalist, information-dense gadgets that are designed to fit right into your modern desktop....- Allows process filtering, defaulting to all system-re
java运行依赖jar包
* True to smoothly scroll to the new item, false to transition * immediately */ public void setCurrentItem(int item, boolean smoothScroll) { mPopulatePending = false; setCurrentItemInternal...
Defaulting to 0x0502 (Windows Server 2003) 正在编译... SetupDlg.cpp RecordDlg.cpp PenteDlg.cpp c:\documents and settings\kjl801\桌面\vc.net 五子棋源码\pentedlg.cpp(45) : warning C4101: 'szVer' : ...
Clicking 'Open File' button opens a [text box] file dialog, defaulting to the sdcard); enter the name of a build.prop type file on the sdcard. (cp /system/build.prop /sdcard/build.prop first) Opening ...
处理slf4j日志使用的基本错误,导入三个包,分别是slf4j-impl,slf4j-api和slf4j-log4j12
[javac] D:\java\wsdd\build.xml:16: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 5 source files to D:\java\...
在运维TongWeb应用的过程中,可能会遇到一些移植问题,尤其是从其他环境如Tomcat迁移到TongWeb时。本文将详细解析三个主要问题及其解决方案,包括JPA冲突、validation问题和annotation扫描异常。...
build-custom-rpm/hhvm (r2dev)$ make ... defaulting to Fedora release 20 (Heisenbug)Evia RPM Build RootName:hhvmSummary:HipHop VM (HHVM) is a virtual machine for executing programs written in PHPPackag