谁能帮我标注下这段java代码的注释呀。看不懂。需要每行注释下,拜托拜托

publicvoidbinding(){Stringfilter="where1=1";Stringteachername=request.getParameter("t... public void binding() {
Stringfilter = "where 1=1 ";
Stringteachername = request.getParameter("teachername");
if(teachername != null)
filter+= " and teachername like '%"+ teachername + "%' ";
intpageindex = 1;
intpagesize = 10;

Stringcurrentpageindex = request.getParameter("currentpageindex");
//当前页面尺寸
Stringcurrentpagesize = request.getParameter("pagesize");
//设置当前页
if(currentpageindex != null)
pageindex= new Integer(currentpageindex);
//设置当前页尺寸
if(currentpagesize != null)
pagesize= new Integer(currentpagesize);
List<Teacher>listteacher = DALBase.getPageEnity("teacher", filter,
pageindex,pagesize);
intrecordscount = DALBase.getRecordCount("teacher",
filter== null ? "" : filter);
request.setAttribute("listteacher",listteacher);
PagerMetalpm = new PagerMetal(recordscount);
//设置尺寸
pm.setPagesize(pagesize);
//设置当前显示页
pm.setCurpageindex(pageindex);
request.setAttribute("pagermetal",pm); // 设置分页信息
// 分发请求参数
dispatchParams(request,response);
Stringforwardurl = request.getParameter("forwardurl");
System.out.println("forwardurl=" +forwardurl);
展开
 我来答
匿名用户
2015-05-10
展开全部
public void binding() {
String filter = "where 1=1 ";//filter一个字符串
String teachername = request.getParameter("teachername");//从前台传来的数据中获取键为teachername的对应的值
if(teachername != null)//如果teachername不为空
filter+= " and teachername like '%"+ teachername + "%' ";
int pageindex = 1;
int pagesize = 10;

String currentpageindex = request.getParameter("currentpageindex");//从前台传来的数据中获取键为currentpageindex的对应的值
//当前页面尺寸
String currentpagesize = request.getParameter("pagesize");//从前台传来的数据中获取键为pagesize的对应的值
//设置当前页
if(currentpageindex != null)//如果(currentpageindex 不为空
pageindex= new Integer(currentpageindex);//将currentpageindex转为Integer对象再赋值给pageindex
//设置当前页尺寸
if(currentpagesize != null)//如果(currentpagesize 不为空
pagesize= new Integer(currentpagesize);
List<Teacher>listteacher = DALBase.getPageEnity("teacher", filter,
pageindex,pagesize);//通过参数从这个类的方法中获取到teacher的list集合
int recordscount = DALBase.getRecordCount("teacher",
filter== null ? "" : filter);//filter== null ? "" : filter如果filter为空则传入空串,否则传入filter本身

request.setAttribute("listteacher",listteacher);//将listteacher设置到request中,键值对
PagerMetal pm = new PagerMetal(recordscount);
//设置尺寸
pm.setPagesize(pagesize);
//设置当前显示页
pm.setCurpageindex(pageindex);
request.setAttribute("pagermetal",pm); // 设置分页信息
// 分发请求参数
dispatchParams(request,response);
Stringforwardurl = request.getParameter("forwardurl");
System.out.println("forwardurl=" +forwardurl);
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式