---
title: "struts2 奇怪的Action警告"
author: "kyo100900"
date: "2008-01-06T21:20:29Z"
tags: []
slug: "struts2-action"
draft: false
lastmod: "2008-01-06T21:20:29Z"
id: 153522
url: "https://superleo.iteye.com/blog/153522"
---

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

 

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">
```

 

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