jsp javaServlet 的心得

<script type="text/javascript"> google_ad_client = "pub-8800625213955058"; /* 336x280, 创建于 07-11-21 */ google_ad_slot = "0989131976"; google_ad_width = 336; google_ad_height = 280; // </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> 先看下面的代码: JSP: <%@ include file="/jsp/includes/common/header.jsp"%> <%@ page import="utility.StringUtil" %> <%@ page import="question.entity.*" %> <%@ page import="system.*" %> <%@ page import="java.text.*" %> <html> <head> <TITLE>Question Inforamtion Page</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="<%=StringUtil.getRealPath()%>css/menu.css"/> <link rel="stylesheet" type="text/css" href="<%=StringUtil.getRealPath()%>css/timesheet.css"> </head> <script> function load(){} function unload(){} </script> <%@ include file="/jsp/includes/template/template1/header.jsp"%> <jsp:useBean id="etmQuestionInformationPages" class="QuestionInformationPages" scope="request"/> <jsp:setProperty name="etmQuestionInformationPages" property="currentPage" param="etmCurrentPage"/> <%@ include file="/jsp/system/checkAccess.jsp"%> <% String functionId = (String)request.getAttribute("etmFunctionID"); String temp = etmQuestionInformationPages.isAscending() ? "asc.gif" : "desc.gif"; String orderBy = etmQuestionInformationPages.getOrderByAttribute(); DateFormat df = new SimpleDateFormat("yyyy/MM/dd"); %> <form name="form1" method="post" action="../question/questionInformation"> <tr> <td class="head"> <!-- Start of Body Title: <%=functionId%>--> <%=StringUtil.getDisplayLabel(request, functionId "-01","Maintain Question Template")%> <!-- End of Body Title --> </td> </tr> <tr> <td> <!-- Start of Action Button --> <jsp:include page="/jsp/system/sysListMenuWithAction.jsp" flush="true"/> <!-- End of Action Button --> </td> </tr> <tr> <td align="center"> <table width="700" border="0" cellspacing="0" cellpadding="0" background="<%=StringUtil.getRealPath()%>jsp/includes/images/clock.gif"> <tr> <td align="center" valign="top"> <table width="700" border="0" cellspacing="0" cellpadding="0" background="<%=StringUtil.getRealPath()%>jsp/includes/images/spacer.gif"> <tr> <!-- Start of Page "Previous / Next" Info. --> <td class="pageInfoRight" colspan="5"> <% if (etmQuestionInformationPages.totalNoOfPages() > 0) { %> <a class="nav" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=list&etmCurrentPage=previous"><%=etmQuestionInformationPages.hasPrevious()?"<img src=/"" StringUtil.getRealPath() "images/arrow_left2.gif/" border=0>":""%></a> <%=appBundle.getString("lblPage1")%> <%=etmQuestionInformationPages.pageNumber()%> <%=appBundle.getString("lblPage2")%> <%=etmQuestionInformationPages.totalNoOfPages()%> <%=appBundle.getString("lblPage3")%> <a class="nav" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=list&etmCurrentPage=next"><%=etmQuestionInformationPages.hasNext()?"<img src=/"" StringUtil.getRealPath() "images/arrow_right2.gif/" border=0>":""%></a> <% } else { %> <br> <% } %> </td> <!-- End of Page "Previous / Next" Info. --> </tr> <tr> <td align="center" valign="top"> <table border="1" cellspacing="0" cellpadding="0" width="100%"> <tr class="header"> <% if (isAuthorized(request, functionId, "batchDelete")) { %> <td width="4%" class="header"> <input type="checkbox" name="checkAll" onclick = "CheckAll()"> </td> <% } %> <td width="12%" class="header"> <a class="menu2" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=refresh&etmOrderBy=ID_QUESTION"> <%=bundle.getString("lblIdQuestion")%></a> <% if(orderBy.equals("ID_QUESTION")) { %> <img src="<%=StringUtil.getRealPath()%>images/<%= temp %>" height=7 hspace=3 width=7 border=0> <% } %> </td> <td width="25%" class="header"> <a class="menu2" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=refresh&etmOrderBy=QUESTION_DESC"> <%=bundle.getString("lblQuestionDesc")%></a> <% if(orderBy.equals("QUESTION_DESC")) { %> <img src="<%=StringUtil.getRealPath()%>images/<%= temp %>" height=7 hspace=3 width=7 border=0> <% } %> </td> <td width="8%" class="header"> <a class="menu2" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=refresh&etmOrderBy=QUESTION_CATEGORY"> <%=bundle.getString("lblQuestionCategory")%></a> <% if(orderBy.equals("QUESTION_CATEGORY")) { %> <img src="<%=StringUtil.getRealPath()%>images/<%= temp %>" height=7 hspace=3 width=7 border=0> <% } %> </td> <td width="21%" class="header"> <a class="menu2" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=refresh&etmOrderBy=QUESTION_CREATION_DATE"> <%=bundle.getString("lblQuestionCreationDate")%></a> <% if(orderBy.equals("QUESTION_CREATION_DATE")) { %> <img src="<%=StringUtil.getRealPath()%>images/<%= temp %>" height=7 hspace=3 width=7 border=0> <% } %> </td> <td width="5%" class="header"> <a class="menu2" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=refresh&etmOrderBy=STATUS"> <%=bundle.getString("lblStatus")%></a> <% if(orderBy.equals("STATUS")) { %> <img src="<%=StringUtil.getRealPath()%>images/<%= temp %>" height=7 hspace=3 width=7 border=0> <% } %> </td> <td width="16%" class="header"> </td> </tr> <% QuestionInformation questionInformation = (QuestionInformation)etmQuestionInformationPages.next(); int offset = 0; while(questionInformation != null) { %> <tr class="data"> <% if(isAuthorized(request, functionId, "batchDelete")) { %> <td class="data"> <input type="checkbox" name="etmItemOffset" value="<%=offset%>"> </td> <% } %> <td class="data"> <a href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=view&etmIdQuestion=<%=questionInformation.getIdQuestion()%>&etmItemOffset=<%=offset%>"><%=questionInformation.getIdQuestion()%></a> </td> <td class="data"> <%=StringUtil.toTextField(questionInformation.getQuestionDesc())%></td> <td class="data"> <%=questionInformation.getQuestionCategory()%></td> <td class="data"> <%=df.format(questionInformation.getCreationDate())%></td> <td class="data"> <%=questionInformation.getStatus()%></td> <td > <% if(isAuthorized(request, "QUES2", "view")) { %> <a class="data" href="<%=StringUtil.getRealPath()%>question/questionDetailInformation?etmAction=view&etmIdQuestion=<%=questionInformation.getIdQuestion()%>&etmItemOffset=<%=offset%>"><%=bundle.getString("lblDetail")%></a> <% } %> <% if(isAuthorized(request, functionId, "edit")) { %> <a class="data" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=edit&etmIdQuestion=<%=questionInformation.getIdQuestion()%>&etmItemOffset=<%=offset%>"><%=appBundle.getString("lblEdit")%></a> <% } %> <a class="data" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=copy&etmCodeSubscriber=<%=questionInformation.getCodeSubscriber()%>&etmIdQuestion=<%=questionInformation.getIdQuestion()%>&etmItemOffset=<%=offset%>">Copy</a> <% if(true || isAuthorized(request, "QUES_REP", "view")) { %> <a class="data" href="<%=StringUtil.getRealPath()%>question/questionReply?etmAction=list&etmIdQuestion=<%=questionInformation.getIdQuestion()%>&etmItemOffset=<%=offset%>"><%=bundle.getString("lblReply")%></a> <% } %> </td> </tr> <% offset ; questionInformation = (QuestionInformation)etmQuestionInformationPages.next(); } %> </table> <tr> <td class="pageInfoRight" colspan="5"> <% if (etmQuestionInformationPages.totalNoOfPages() > 0) { %> <a class="nav" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=list&etmCurrentPage=previous"><%=etmQuestionInformationPages.hasPrevious()?"<img src=/"" StringUtil.getRealPath() "images/arrow_left2.gif/" border=0>":""%></a> <%=appBundle.getString("lblPage1")%> <%=etmQuestionInformationPages.pageNumber()%> <%=appBundle.getString("lblPage2")%> <%=etmQuestionInformationPages.totalNoOfPages()%> <%=appBundle.getString("lblPage3")%> <a class="nav" href="<%=StringUtil.getRealPath()%>question/questionInformation?etmAction=list&etmCurrentPage=next"><%=etmQuestionInformationPages.hasNext()?"<img src=/"" StringUtil.getRealPath() "images/arrow_right2.gif/" border=0>":""%></a> <% } else { %> <br> <% } %> </td> </tr> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td> <!-- Start of Action Button --> <jsp:include page="/jsp/system/sysListMenu.jsp" flush="true"/> <!-- End of Action Button --> <jsp:include page="/jsp/system/message.jsp" flush="true"/> </td> </tr> </form> <%@ include file="/jsp/includes/template/template1/footer.jsp"%> 一般把页面分为, 菜单, 功能菜单, 详细内容, 汇总部分, 和页脚 (大家先分析一下, 待续)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值