小弟在做网站的时候遇到action会被执行两次的情况,在网上找了资料,也没能解决。
首先我在index的页面写了一个链接
<a href="Employees/EmployeesPage">123</a>
这个页面跳转到EmployeesPage这个action
代码如下
<action name="EmployeesPage" class="com.lsxy.action.EmployeesAction" method="go">
<result name="addPage">/EmployeesAddPage.jsp</result>
</action>
method go的方法如下:
public String go() {
QsCtypeDao ctypeDao = new QsCtypeDao();
ctype = ctypeDao.findAll();
System.out.println("123");
return "addPage";
}
输出的时候 控制台有2个123 并有警告。
123
2011-6-19 11:31:02 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: '/Employees/EmployeesAdd' in namespace: '/Employees'. Form action defaulting to 'action' attribute's literal value.
2011-6-19 11:31:02 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: '/Employees/EmployeesAdd' in namespace: '/Employees'. Form action defaulting to 'action' attribute's literal value.
2011-6-19 11:31:02 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: '/Employees/EmployeesAdd' in namespace: '/Employees'. Form action defaulting to 'action' attribute's literal value.
2011-6-19 11:31:02 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: '/Employees/EmployeesAdd' in namespace: '/Employees'. Form action defaulting to 'action' attribute's literal value.
123
各位大大有没有遇到过类似的情况?如何解决呢?