Hello,
I am writting a program for HR application using
struts 1.2.
It's a Action file.. but when every I wrote :
"public class SearchAction extends Action{
{
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response ) throws Exception "
It's shows and error on "execute","response " and for comma(",")
IDE say's ";" semicolon is required.
here is my full Action file. Plese help me to resolve it.
package com.jamesholemes.struts;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class SearchAction extends Action{
{
public ActionForward execute(ActionMapping mapping;
ActionForm form;
HttpServletRequest request;
HttpServletResponse response ) throws Exception
{
EmployeeSearchService service = new EmployeeSearchService();
ArrayList results;
SearchForm searchForm =(SearchForm) form;
String name = searchForm.getName();
if(name!=null && name.trim().length() >0)
{
result=service.searchByName(name);
}
else
{
result = service.searchBySsNum(searchForm.getSsNum().trim());
}
searchForm.setResult(results);
return mapping.getInputForward();
}
}
}
Thanks