1>、(包括對這一路徑下的目標列表中目標的瀏覽和目標的日記列表的瀏覽,和檢索目標列表中目標的瀏覽,和檢索日記列表中日記的瀏覽):public static String getPreNextNaviStr( char toPageType, String url, HttpServletRequest request, String naviStr, int currentID, String condition,int orderType, int direction) throws Exception。輸入參數是:toPageType-請求的頁面類型,url-請求的頁面的“/***Action.do”路徑,request-請求對象,naviStr-當前頁面的導航封裝字符串,currentID-當前條目的ID,condition-查詢的where子句,orderType-排序類型,direction-排序方向。為了分離數據庫訪問的代碼,在這個方法中調用了一個直接訪問數據庫的類(/WEB-INF/src/com/learndiary/website/db/PageDB.java)中的方法(public int[] getAdjacentIDs(String tableName, int currentID, String condition, int orderType, int direction) throws Exception )來得到含有前一條、當前、后一條帖子ID的數組;
2>、(包括對檢索日記列表的日記所在目標、日記所在目標下的日記列表的瀏覽):public static String getPreNextNaviStr(String url, HttpServletRequest request, String naviStr, int searchDiaryID, String condition,int orderType, int direction) throws Exception。輸入參數是:url-請求的頁面的“/***Action.do”路徑,request-請求對象,naviStr-當前頁面的導航封裝字符串,searchDiaryID-搜索日記列表中當前日記的ID,condition-查詢的where子句,orderType-排序類型,direction-排序方向。為了分離數據庫訪問的代碼,在這個方法中調用了一個直接訪問數據庫的類(/WEB-INF/src/com/learndiary/website/db/PageDB.java)中的方法(public int[] getAdjacentIDs(String tableName, int currentID, String condition, int orderType, int direction) throws Exception )來得到含有前一條、當前、后一條帖子ID的數組;
3>、(包括對進行中的目標、退出的目標、完成的目標列表中目標的瀏覽):public static String getPreNextNaviStr(String url, HttpServletRequest request, String naviStr, int userID, int currentID, int myGoalTypeFlag, int orderType, int direction) throws Exception。輸入參數是:url-請求的頁面的“/***Action.do”路徑,request-請求對象,naviStr-當前頁面的導航封裝字符串,userID-當前用戶ID,currentID-當前條目的ID,myGoalTypeFlag-用戶目標的類型(進行、退出、或者完成),orderType-排序類型,direction-排序方向。為了分離數據庫訪問的代碼,在這個方法中調用了一個直接訪問數據庫的類(/WEB-INF/src/com/learndiary/website/db/PageDB.java)中的方法(public int[] getAdjacentIDs(int userID,int currentID, int myGoalTypeFlag, int orderType, int direction) throws Exception)來得到含有前一條、當前、后一條帖子ID的數組;