<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    JPBC ing: 留言板之三:留言板JSP代碼

    <! DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN" >
    <% @?page?language = " java " ?import = " java.util.*,DAO.impl.*,bean.* "
    ????pageEncoding
    = " GBK "
    %>
    < jsp:useBean? id ="messageBoard" ?scope ="page"
    ????class
    ="bean.MessageBoardBean" ? />
    <% ! int ?totalPages;? // 頁面總數

    ????
    int ?totalCount;? // 留言總數

    ????
    int ?currentPage;? // 當前頁面

    ????
    int ?currentStart;? // 當前頁面的第一條留言

    ????
    int ?countPerPage? = ? 5 ;? // 設置頁面可容納的留言總數
    %>
    <%
    ????MessageDAOMySQL?messageDAO?
    = ? new ?MessageDAOMySQL();
    ????List?messageList?
    = ?messageDAO.getMessageList();
    ????totalCount?
    = ?messageList.size();
    ????totalPages?
    = ?( int )?Math.ceil(( double )?totalCount? / ?countPerPage);

    ????
    if ?(request.getParameter( " page " )? == ? null )?{
    ????????currentPage?
    = ? 1 ;
    ????}?
    else ?{
    ????????currentPage?
    = ? Integer .parseInt(request.getParameter( " page " ));
    ????????
    if ?(currentPage? < ? 1 )?{
    ????????????currentPage?
    = ? 1 ;
    ????????}?
    else ? if ?(currentPage? > ?totalPages)?{
    ????????????currentPage?
    = ?totalPages;
    ????????}

    ????}

    ????currentStart?
    = ?totalCount? - ?countPerPage? * ?(currentPage? - ? 1 );
    %>

    < html >
    ????
    < head >
    ????????
    < title > My?JSP?'MessageBoard.jsp'?starting?page </ title >

    ????????
    < meta? http-equiv ="pragma" ?content ="no-cache" >
    ????????
    < meta? http-equiv ="cache-control" ?content ="no-cache" >
    ????????
    < meta? http-equiv ="expires" ?content ="0" >
    ????????
    < meta? http-equiv ="keywords" ?content ="keyword1,keyword2,keyword3" >
    ????????
    < meta? http-equiv ="description" ?content ="This?is?my?page" >
    ????????
    <!--
    ????<link?rel="stylesheet"?type="text/css"?href="styles.css">
    ????
    -->

    ????
    </ head >

    ????
    < body >
    ????????
    < table? width ="100%" ?border ="0" ?cellspacing ="0" ?cellpadding ="0" >
    ????????????
    < tr >
    ????????????????
    < td? align ="center" >
    ????????????????????
    < table? border ="0" ?width ="95%" ?cellpadding ="0" ?cellspacing ="0" >
    ????????????????????????
    < tr >
    ????????????????????????????
    < td? height ="24" >
    ????????????????????????????????
    < img? src ="cssjpgfiles/Com.gif" ?border ='0' >
    ????????????????????????????????
    < font? face ="宋體" ?size ="3" ?color ="#F9860A"
    ????????????????????????????????????style
    ="font-weight:bold" > BBS反饋 </ font >
    ????????????????????????????
    </ td >
    ????????????????????????????
    < td? align ="right" >
    ????????????????????????????
    </ td >
    ????????????????????????
    </ tr >
    ????????????????????
    </ table >
    ????????????????
    </ td >
    ????????????
    </ tr >
    ????????
    </ table >

    ????????
    <%
    ????????????
    for ?( int ?i? = ? 0 ;?(i? < ?countPerPage)? && ?((currentStart? - ? 1 ? - ?i)? >= ? 0 );?i ++ )?{
    ????????????????messageBoard.setUserName(((MessageBoardBean)?messageList
    ????????????????.get(currentStart?
    - ? 1 ? - ?i)).getUserName());
    ????????????????messageBoard.setTitle(((MessageBoardBean)?messageList
    ????????????????.get(currentStart?
    - ? 1 ? - ?i)).getTitle());
    ????????????????messageBoard.setWords(((MessageBoardBean)?messageList
    ????????????????.get(currentStart?
    - ? 1 ? - ?i)).getWords());
    ????????????????messageBoard.setTime(((MessageBoardBean)?messageList
    ????????????????.get(currentStart?
    - ? 1 ? - ?i)).getTime());
    ????????
    %>

    ????????
    < table? width ="98%" ?border ="1" ?cellspacing ="0" ?cellpadding ="0"
    ????????????bordercolordark
    ="#FFFFFF" ?bordercolorlight ="#CCCCCC" >
    ????????????
    < tr >
    ????????????????
    < td? height ="22" ?colspan ="2" >
    ????????????????????
    < table? width ="100%" ?border ="0" ?cellpadding ="0" ?cellspacing ="0" >
    ????????????????????????
    < tr >
    ????????????????????????????
    < td? height ="22" >
    ????????????????????????????????用戶:?
    <% = messageBoard.getUserName() %>
    ????????????????????????????
    </ td >
    ????????????????????????????
    < td? align ="right" >
    ????????????????????????????????
    &nbsp;
    ????????????????????????????????
    <% = messageBoard.getTime() %>
    ????????????????????????????
    </ td >
    ????????????????????????
    </ tr >
    ????????????????????
    </ table >
    ????????????????
    </ td >
    ????????????
    </ tr >
    ????????????
    < tr >
    ????????????????
    < td? width ="109" ?height ="100" ?align ="center" ?valign ="top" >
    ????????????????????
    < img? src ="cssjpgfiles/bs.GIF" ?border ="0" >
    ????????????????
    </ td >
    ????????????????
    < td? width ="588" ?valign ="top" >
    ????????????????????
    < table? width ="100%" ?border ="0" ?cellpadding ="0" ?cellspacing ="0" >
    ????????????????????????
    < tr >
    ????????????????????????????
    < td? height ="22" ?bgcolor ="#EDEDED" >
    ????????????????????????????????
    < font? color ="#FF0000" > 主題: <% = messageBoard.getTitle() %> ? </ font >
    ????????????????????????????
    </ td >
    ????????????????????????
    </ tr >
    ????????????????????????
    < tr >
    ????????????????????????????
    < td? height ="5" ></ td >
    ????????????????????????
    </ tr >
    ????????????????????????
    < tr >
    ????????????????????????????
    < td
    ????????????????????????????????
    style ="WORD-WRAP:?break-word;?line-height:15pt;?font-size:?10pt;" >
    ????????????????????????????????
    < font? color ="#0290C7" > <% = messageBoard.getWords() %> ? </ font >
    ????????????????????????????
    </ td >
    ????????????????????????
    </ tr >
    ????????????????????
    </ table >
    ????????????????
    </ td >
    ????????????
    </ tr >
    ????????
    </ table >
    ????????
    <%
    ????????}
    ????????
    %>

    ????????
    < table? width ="95%" ?border ="0" ?cellpadding ="0" ?cellspacing ="0" >
    ????????????
    < tr >
    ????????????????
    < td? height ="30" >
    ????????????????????
    < a? href ='MessageBoard.jsp?page=1'? clases =706501? title ='第一頁' > [ < |]</a >
    ????????????????????
    < a? href ='MessageBoard.jsp?page=<%=? currentPage-1?% > '?title='前一頁'>[ < ]</a >
    ????????????????????
    < font? color =#ff0000 > [ <% = ?currentPage? %> ] </ font >
    ????????????????????
    <%
    ????????????????????????
    for ?( int ?i? = ?currentPage? + ? 1 ;?i? <= ?totalPages;?i ++ )?{
    ?????????????????????
    %>
    ????????????????????
    < a? href ='MessageBoard.jsp?page=<%=? i?% > '>[ <% = ?i? %> ] </ a >
    ????????????????????
    <%
    ????????????????????????}
    ?????????????????????
    %>
    ????????????????????
    < a? href ='MessageBoard.jsp?page=<%=? currentPage+1?% > '?title='后一頁'>[>] </ a >
    ????????????????????
    < a? href ='MessageBoard.jsp?page=<%=? totalPages?% > '?clases=706501?title='最后一頁'>[>|] </ a >
    ????????????????
    </ td >
    ????????????????
    < td? align ="center" > 第? <% = ?currentPage? %> ?頁,共? <% = ?totalPages? %> ?頁,每頁? <% = ?countPerPage? %> ?條,共有? <% = ?totalCount? %> ?條留言 </ td >
    ????????????????
    ????????????
    </ tr >
    ????????
    </ table >

    ????
    </ body >
    </ html >

    posted on 2008-10-16 23:54 nonels 閱讀(635) 評論(1)  編輯  收藏 所屬分類: J2EE

    評論

    # re: JPBC ing: 留言板之三:留言板JSP代碼 2016-04-22 09:09 545

    210  回復  更多評論   

    <2016年4月>
    272829303112
    3456789
    10111213141516
    17181920212223
    24252627282930
    1234567

    導航

    統計

    常用鏈接

    留言簿(2)

    隨筆分類(16)

    隨筆檔案(16)

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 七次郎成人免费线路视频| 国产婷婷成人久久Av免费高清 | 国产成人精品日本亚洲专区6| 国产拍拍拍无码视频免费| 亚洲精品午夜无码专区| kk4kk免费视频毛片| 好男人www免费高清视频在线| 亚洲国产成人精品青青草原| 免费能直接在线观看黄的视频| 亚洲无圣光一区二区| 国产成人精品免费视频大全| 2048亚洲精品国产| 亚洲熟妇无码八V在线播放| 久久er国产精品免费观看2| 亚洲人成电影亚洲人成9999网| 性色午夜视频免费男人的天堂 | 免费无码黄动漫在线观看| 国产精品亚洲成在人线| 一区二区三区无码视频免费福利 | 免费黄色app网站| 国产亚洲美女精品久久久久| 国产精品成人观看视频免费| 亚洲国产日韩视频观看| 亚洲AV日韩精品一区二区三区| 2022年亚洲午夜一区二区福利| 日韩国产免费一区二区三区| 色天使色婷婷在线影院亚洲| 暖暖在线日本免费中文| 亚洲天堂2017无码中文| 亚洲?V无码成人精品区日韩| 国产成人免费ā片在线观看老同学| 亚洲综合精品一二三区在线| 久久精品视频免费| 色天使亚洲综合在线观看| 亚洲国产精品尤物yw在线| 99爱视频99爱在线观看免费| 亚洲国产二区三区久久| 天天拍拍天天爽免费视频| 精品乱子伦一区二区三区高清免费播放| 亚洲国产黄在线观看| 99久久人妻精品免费一区|