Open Nav

人力资源管理系统毕业论文设计范文(JSP)(9)

以下是资料介绍,如需要完整的请充值下载.
1.无需注册登录,支付后按照提示操作即可获取该资料.
2.资料以网页介绍的为准,下载后不会有水印.仅供学习参考之用.
   帮助中心
资料介绍:

   return dao;
  } catch (InstantiationException e) {
   e.printStackTrace();
  } catch (IllegalAccessException e) {
   e.printStackTrace();
  }
  return null;
 }
}
Pagination类:
public class public class Pagination {
 private int rowCount;
 private int rowOfPage=15;
 private int curPage = 1;
 private int pageCount;

[版权所有:http://DOC163.com]

 public Pagination() {

[资料来源:https://www.doc163.com]

 }
 public Pagination(int rowCount) {
  setRowCount(rowCount);
 }
 public Pagination(int rowCount, int rowOfPage) {
  setRowCount(rowCount);
  setRowOfPage(rowOfPage);
 }
 public void setRowCount(int rowCount){
  this.rowCount=rowCount;
  init();
 }
 
 public int getRowCount() {
  return rowCount;
 }
 public void setCurPage(int pageNum) {
  this.curPage = pageNum;
 }
 public void setRowOfPage(int rowOfPage) {
  this.rowOfPage = rowOfPage;
  init();
 }
 
 private void init(){
  pageCount=(int) java.lang.Math.ceil((double)rowCount / (double)rowOfPage);
 }
 public int getCurPage(){
  return curPage;
 }
 public int getPageCount(){

[来源:http://Doc163.com]

  return pageCount;
 }
 public int getFirst() {
  return 1;
 } [资料来源:http://Doc163.com]

 public int getNext() {
  if (pageCount> curPage) {
   return curPage+1;
  } else {
   return pageCount;
  }
 } [资料来源:Doc163.com]

 public int getPrevious() {
  if (curPage > 1){
   return curPage - 1;
  }
  return 1;
 } [资料来源:http://www.doc163.com]

 public int getLast() {
  return pageCount;
 }

[资料来源:http://www.doc163.com]

 public int getStartRow() {
  return (this.curPage - 1) * this.rowOfPage;
 }

[资料来源:http://doc163.com]

 public int getEndRow() {
  return curPage * this.rowOfPage;
 }
}
{
 private int rowCount;
 private int rowOfPage=15;
 private int curPage = 1;
 private int pageCount;

[资料来源:Doc163.com]

 public Pagination() { [资料来源:http://Doc163.com]

 }
 public Pagination(int rowCount) {
  setRowCount(rowCount);
 }
 public Pagination(int rowCount, int rowOfPage) {
  setRowCount(rowCount);
  setRowOfPage(rowOfPage);
 }
 public void setRowCount(int rowCount){
  this.rowCount=rowCount;
  init();
 }
 
 public int getRowCount() {
  return rowCount;
 }
 public void setCurPage(int pageNum) {
  this.curPage = pageNum;
 }
 public void setRowOfPage(int rowOfPage) {
  this.rowOfPage = rowOfPage;
  init();
 }
 
 private void init(){
  pageCount=(int) java.lang.Math.ceil((double)rowCount / (double)rowOfPage);
 }
 public int getCurPage(){
  return curPage;
 }
 public int getPageCount(){ [来源:http://www.doc163.com]
  return pageCount;
 }
 public int getFirst() {
  return 1;
 } [来源:http://Doc163.com]

 public int getNext() {
  if (pageCount> curPage) {
   return curPage+1;
  } else {
   return pageCount;
  }
 } [资料来源:http://www.doc163.com]

 public int getPrevious() {
  if (curPage > 1){
   return curPage - 1;
  }
  return 1;
 }

[来源:http://Doc163.com]

 public int getLast() {
  return pageCount;
 } [资料来源:www.doc163.com]

 public int getStartRow() {
  return (this.curPage - 1) * this.rowOfPage;
 }

[来源:http://www.doc163.com]

 public int getEndRow() {
  return curPage * this.rowOfPage;
 }
}
Controller层代码:
Action类:
public abstract class Action {
 protected final String SUCCESS="success";
 protected final String FAILURE="failure";
 protected ActionMessage message=new ActionMessage();
 protected Connection conn;
 protected abstract String execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException ;
 public String process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  request.setAttribute("message", message);
  return execute(request, response);
 }
 public void setConn(Connection conn){
  this.conn=conn;
 }
 protected abstract DTO initDTO(HttpServletRequest request);
 protected abstract boolean validate(DTO dto); [资料来源:http://doc163.com]
}
ActionConfig类:
public class ActionConfig {
 
 
 private static ActionConfig actionConfig;
 private Map<String,ActionInfo> actionInfos=new HashMap<String, ActionInfo>();
 private ActionConfig(URL url) throws JDOMException, IOException{
  SAXBuilder builder=new SAXBuilder();
  Document doc = builder.build(url);
  List<Element> list = XPath.selectNodes(doc,"//action-config/action");
  Iterator<Element> iter=list.iterator();

[来源:http://Doc163.com]

  while(iter.hasNext()){
   Element actionElt=iter.next();
   ActionInfo actionInfo=getActionInfo(actionElt);
   
   actionInfos.put(actionInfo.getPath(), actionInfo);
  }
  
  
 }
 private ActionInfo getActionInfo(Element actionElt) {
  ActionInfo action=new ActionInfo();
  action.setPath(actionElt.getAttributeValue("path"));
  action.setActionClass(actionElt.getAttributeValue("actionClass"));
  
  List<Element> list = actionElt.getChildren();
  Iterator<Element> iter=list.iterator();

[资料来源:www.doc163.com]

  while(iter.hasNext()){
   Element forwardElt=iter.next();
   ActionForward forward=getForward(forwardElt);
   action.addActionForward(forward);
  }
  return action;
 }
 private ActionForward getForward(Element forwardElt) {
  ActionForward actionForward=new ActionForward();
  actionForward.setName(forwardElt.getAttributeValue("name"));
  actionForward.setPath(forwardElt.getAttributeValue("path"));
  actionForward.setRedirect(Boolean.parseBoolean(forwardElt.getAttributeValue("redirect")));
  return actionForward;
 }
 public static void init(URL url) throws JDOMException, IOException{
  if(actionConfig==null){
   actionConfig=new ActionConfig(url);
  }
 }
 public static ActionInfo getActionInfo(String path){ [来源:http://www.doc163.com]
  if(actionConfig==null){
   System.out.println("没有初始化");

  • 关于资料
    提供的资料属本站所有,真实可靠,确保下载的内容与网页资料介绍一致.
  • 如何下载
    提供下载链接或发送至您的邮箱,资料可重复发送,若未收到请联系客服.
  • 疑难帮助
    下载后提供一定的帮助,收到资料后若有疑难问题,可联系客服提供帮助.
  • 关于服务
    确保下载的资料和介绍一致,如核实与资料介绍不符,可申请售后.
  • 资料仅供参考和学习交流之用,请勿做其他非法用途,转载必究,如有侵犯您的权利或有损您的利益,请联系本站,经查实我们会立即进行修正! 版权所有,严禁转载
    doc163.com Copyright © 2012-2024 苏ICP备2021029856号-4