码迷,mamicode.com
首页 > 其他好文 > 详细

Friend's Code Review

时间:2017-03-24 20:01:56      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:tps   string   else   set   ice   ret   strong   bean   his   

代码:

```

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

标签:tps   string   else   set   ice   ret   strong   bean   his   

原文地址:http://www.cnblogs.com/yuhouwuqiong/p/6613087.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!