2008-01-06

struts2 奇怪的Action警告

关键字: action, 警告

不知道大家有没有遇到在使用表单的时候,有时候会出一个莫名其妙的警告:

 

2008-1-6 21:14:47 org.apache.struts2.components.Form evaluateExtraParamsServletRequest
警告: No configuration found for the specified action: '/LoginAction.action' in namespace: '/'. Form action defaulting to 'action' attribute's literal value.

登录的时候,要表单提交到Action:LoginAction.action, 结果却出了这个警告,暂时没明白为什么,因为程序不影响正常使用。但总有解决的办法吧。

以下写法均会出这个警告

 

<s:form action="/LoginAction" method="post">
<s:form action="/LoginAction.action" method="post">
<s:form action="LoginAction.action" method="post">

 

正确的写法只有:

 

<s:form action="LoginAction" method="post">

 

如果有明白为什么的,希望能留个言。

评论
reinhardt49 2008-01-24   回复
把'/LoginAction.action' 中的/去除
reinhardt49 2008-01-24   回复
把'/LoginAction.action' 中的/去除
reinhardt49 2008-01-24   回复
把'/LoginAction.action' 中的 '/' 去掉
kyo100900 2008-01-09   回复
请注意看: <s:form action="LoginAction" method="post"> 
用到了 struts2 自带的标签, Struts2标签会在提交时,加上extension
dingdangxiaoma 2008-01-08   回复
您好,您所说的这个是有问题的呢.我已经试过了啊.不行的.

引用
struts.properties   struts.action.extension=action


如果,像您那样写提交的话,会把它当作一个servlet 来进行处理,而不是当作一个.action 来进行处理,所以那样做是不对的呢.
在java 中,一般的没有后缀的文件,也就是Servlet 吧.而且,这样写就把,它们混在一起了,也不利于维护啊.呵.
发表评论

您还没有登录,请登录后发表评论

kyo100900
搜索本博客
我的相册
D46f825f-d2ec-3417-a6d4-74c8a0628571-thumb
hibernate_lazy_01
共 34 张
最近加入圈子
存档
最新评论