String ename=this.getRequest().getParameter("employeeName");
package com.isoftstone.smsfe.web.action.account;
import java.util.List;
import com.isoftstone.smsfe.biz.service.SearchService;
import com.isoftstone.smsfe.common.core.AbstractAction;
import com.isoftstone.smsfe.entity.EmployeeInfo;
public class SearchAction extends AbstractAction {
private SearchService searchService;
private EmployeeInfo employee;
public void setSearchService(SearchService searchService) {
this.searchService=searchService;
}
public Object getViewModel() {
return employee;
}
public String execute() throws Exception {
String ename=this.getRequest().getParameter("employeeName"); List<EmployeeInfo> employeeInfo= searchService.searchEmployee(ename);
if(employeeInfo==null){
return "input";
}else{
for(int i=0;i<employeeInfo.size();i++){
System.out.println(employeeInfo.get(i).getEmployeeName());
}
this.getSession().put("employeeInfo", employeeInfo);
return "success";
}
}
/**
* @return the employee
*/
public EmployeeInfo getEmployee() {
return employee;
}
/**
* @param employee the employee to set
*/
public void setEmployee(EmployeeInfo employee) {
this.employee = employee;
}
}
为什么会出现错误:
The method getRequest() is undefined for the type SearchAction