java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [clientAction]运行的时候我调用Action中的Update方法就出现这个情况 在别的累也引用了这个方法 没错 但是这里就出错了,这个方法是异步方法 无返回值struts.xml<package name="client" extends="struts2">
<action name="c" class="clientAction">
<result name="show">/jsp/client/clientInfo.jsp</result>
<result name="direct" type="redirect">/c!findByPages.action</result>
</action>
</package>Action代码:package com.baiheng.base.client.action;import java.util.List;import com.baiheng.base.client.domain.Client;
import com.baiheng.base.client.service.IClientService;
import com.baiheng.tool.util.stream.Zmxpage;
import com.opensymphony.xwork2.ActionSupport;public class ClientAction extends ActionSupport { /**
 * 
 */
private static final long serialVersionUID = 1L;
/**
 * 
 */
 int currentNo = 1;
 int pageSize = 10;
 int totalPages;
 IClientService icService;


List clientList;
Zmxpage pages;
Client client;
private String column;
private String text;
private Long id;

public String findByPages() throws Exception {
String sql = "from com.baiheng.base.client.domain.Client";
pages.getPages(currentNo, pageSize, sql);
clientList = pages.findByPage();
totalPages = pages.gettotalPages();
return "show";
}

public String save() throws Exception {
icService.save(client);
return "direct";
}

public String delete() throws Exception {
client = icService.findById(id);
icService.delete(client);
return "direct";
}
就是这个地方出错了 一调用他就不知道怎么回事 ;老出这个错误 我在火狐的FireBug中看到的
public void update() throws Exception {
icService.updateByPages(column, text, id);
}



public IClientService getIcService() {
return icService;
} public void setIcService(IClientService icService) {
this.icService = icService;
} public int getCurrentNo() {
return currentNo;
} public void setCurrentNo(int currentNo) {
this.currentNo = currentNo;
} public int getPageSize() {
return pageSize;
} public void setPageSize(int pageSize) {
this.pageSize = pageSize;
} public int getTotalPages() {
return totalPages;
} public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
} public List getClientList() {
return clientList;
}
public void setClientList(List clientList) {
this.clientList = clientList;
}
public Client getClient() {
return client;
}
public void setClient(Client client) {
this.client = client;
}
public Zmxpage getPages() {
return pages;
} public void setPages(Zmxpage pages) {
this.pages = pages;
} public String getColumn() {
return column;
} public void setColumn(String column) {
this.column = column;
} public String getText() {
return text;
} public void setText(String text) {
this.text = text;
} public Long getId() {
return id;
} public void setId(Long id) {
this.id = id;
}}
Jquery部分代码
var id=td.parent().children().eq(0).html();
var id1 = parseInt(id); 
$.post("c!update.action",
{id:id,column:columnname,text:inputtext},
null,
function(response){
var flag=response;
alert(flag);
if(flag=="true"){
td.html(inputtext);
}else{
alert("更新失败");
td.html(text);
}
});

解决方案 »

  1.   

    你的struts配置文件  也没配置 update的方法呀    所以,找不到。
    <action name="update" class="clientAction" method="update">
        <result name="success type="redirect">你都更新了,可以返回当前的action</result>
    </action>
      

  2.   

    楼主的那个update()方法好像没有返回值,注意一下
      

  3.   


    <action name="update" class="clientAction" method="update">     
    <result type="redirect">你都更新了,可以返回当前的action</result> 
    </action>  
    其实我注意到了,还是习惯性的 写上了   success