首页 > 代码库 > Friend's Code Review
Friend's Code Review
代码:
```
package lservice;
import java.util.Date;
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;
import lbean.readerform;
import ldao.Readerdao;
public class Reader extends Action{
private Readerdao readerDAO = null;
public Reader() {
this.readerDAO = new Readerdao();
}
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
String action =request.getParameter("action");
System.out.println("\nreader*********************action="+action);
if(action==null||"".equals(action)){
request.setAttribute("error","您的操作有误!");
return mapping.findForward("error");
}else if("readerAdd".equals(action)){
return readerAdd(mapping,form,request,response);
}else if("readerQuery".equals(action)){
return readerQuery(mapping,form,request,response);
}else if("readerModifyQuery".equals(action)){
return readerModifyQuery(mapping,form,request,response);
}else if("readerModify".equals(action)){
return readerModify(mapping,form,request,response);
}else if("readerDel".equals(action)){
return readerDel(mapping,form,request,response);
}else if("readerDetail".equals(action)){
return readerDetail(mapping,form,request,response);
}
request.setAttribute("error","操作失败!");
return mapping.findForward("error");
}
```
需要改的地方:
包名的大小写问题:
```
package lservice;//大小写
```
无用的import删除:
```
import lbean.readerform;
import ldao.Readerdao;
```
Friend's Code Review