jsp+javaServlet 的心得

时间:2010-01-19 08:56:55   来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:t;<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.cs...
  正文:

先看下面的代码: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.hASP/ target=_blank class=infotextkey>asprevious()?"<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"%>一般把页面分为, 菜单, 功能菜单, 详细内容, 汇总部分, 和页脚(大家先分析一下, 待续)
来源:http://www.002pc.com/master/College/Programming/JSP/12024.html

收藏到:

关于《jsp+javaServlet 的心得》文章的评论

共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面

随机文章

    SQL Error: select * from ***_ecms_article where classid='85' and checked=1 order by rand() limit 10

顶出来的热门

    SQL Error: select * from ***_ecms_article where classid='85' and checked=1 order by diggtop desc,id desc limit 10
站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td