一個項目中的jsp代碼

來源:互聯網
上載者:User

index.jsp: <meta http-equiv="Refresh" content="0;URL=./pages/login.jsp" />

login.jsp
<body onload="document.all.name2.focus()">
<td width="60%"><html:text maxlength="30" property="epNo" size="20" styleId="name2" onblur="loadUser()"/>&nbsp;</td>
<html:image property="button" onclick="loginSubmit('userLogin');saveCookie();" border="0" page="/pages/images/logon_icon.gif"/>
<td align="left"><html:image property="button" onclick="loginSubmit('changePassword')" border="0" page="/pages/images/logon_repw.gif"/>
<script language="javascript">
function loginSubmit(choice){
    document.all.selectID.value=choice;
    loginFormBean.submit();
}
</script>
<script language="javascript">
<!--Hide script from older browsers
function loadUser()
{
    var cookieName="";
    var cookieValue="";
    cookieName=document.all.name2.value;
    cookieValue=readCookie(cookieName);
    if(cookieValue!='')
      document.all.name4.value=cookieValue;
}
function saveCookie()
{
    var cName=document.all.name2.value;
    var cValue=document.all.name4.value;
    setCookie(cName,cValue);
}
function setCookie(name,value)
{
  date=new Date();
  date.setMonth(date.getMonth()+6);
  document.cookie=name+"="+escape(value)+"; expires=" + date.toGMTString();
}
function readCookie(name)
{
  //if there is no cookie,return false,else return the value.
  if(document.cookie=='')
     return false;
   else
     return unescape(getCookieValue(name));
}
function getCookieValue(name)
{
   //Declare variables.
   var firstChar,lastChar;
   //Get the entire cookie string.
   var theBigCookie=document.cookie;
   //alert(theBigCookie);
   firstChar=theBigCookie.indexOf(name);
   if(firstChar!=-1)
   {
     firstChar+=name.length+1;
  lastChar=theBigCookie.indexOf(';',firstChar);
  if(lastChar==-1)lastChar=theBigCookie.length;
  return theBigCookie.substring(firstChar,lastChar);
   }
   else
   return false;
}
//end hiding javascript -->
</script>

header.jsp
<td><html:link styleClass="Menu_F13" page="/pages/client/menu.jsp" target="leftFrame">客戶關係管理</html:link></td>
<td><html:img width="20" height="28" page='/pages/images/menu_bg.jpg'/></td>
<%
   Date nowDate = new Date();
   SimpleDateFormat yearFor = new SimpleDateFormat("yyyy");
   SimpleDateFormat monthFor = new SimpleDateFormat("MM");
   SimpleDateFormat dayFor = new SimpleDateFormat("dd");
   SimpleDateFormat timeFor = new SimpleDateFormat("HH:mm");

   String yearStr = yearFor.format(nowDate);
   String monStr = monthFor.format(nowDate);
   String dayStr = dayFor.format(nowDate);
   String cTime = timeFor.format(nowDate);

%>

left.jsp
<iframe src="client/menu.jsp" width="100%" height="100%" name="leftFrame" marginwidth="0" marginheight="0" scrolling="auto" frameborder="no" border="0">

help.jsp
  <logic:present name="Login_User">
  <tr>
    <td background="images/top_search_bg.gif">&nbsp;&nbsp;<font color="#FF0000"><bean:write name="Login_User" property="realName"/></font>,歡迎您使用融眾業務管理系統!</td>
  </tr>
  </logic:present>

hint.jsp
          <logic:present name="newBookedList">
          <logic:iterate id="booknew" name="newBookedList"  type="cn.rzdd.cbs.persistence.po.Appformbooklog" length="3" >
         <html:link href="client/appList1.jsp">
          <bean:write name="booknew" property="afmId" />&nbsp;&nbsp;
        </html:link>
          </logic:iterate>
          </logic:present>

index2.jsp
<frameset rows="108,*,28" frameborder="NO" border="0" framespacing="0">
  <frame src="<html:rewrite page='/pages/header.jsp'/>" name="top" scrolling="NO" noresize>
  <frameset rows="*" cols="215,*" framespacing="0" frameborder="NO" border="0">
  <frame src="<html:rewrite page='/pages/left.jsp'/>" name="left" scrolling="NO" noresize>
  <frame src="<html:rewrite page='/pages/center.jsp'/>" name="rightFrame" scrolling="yes" noresize>
 </frameset>

  <frame src="<html:rewrite page='/pages/state.jsp'/>" name="state" scrolling="NO" noresize>
 </frameset> 

center.jsp
<jsp:include page="/pages/hint.jsp" flush="false"/>

menu.jsp
       <script type="text/javascript">
  <!--

  d = new dTree('d');

  d.add(0,-1,'客戶關係管理');
              <%
                if(user.hasAccess(roleList,"101")){%>
  d.add(1,0,'客戶資訊管理','customerInfoList2.jsp',"",'rightFrame');
               <%}else{%>
               d.add(1,0,'客戶資訊管理','',"",'rightFrame');
                <%}
               if(user.hasAccess(roleList,"102")){%>
               d.add(2,0,'申請單資訊管理','appList1.jsp',"",'rightFrame');
                 <%}else{%>
                 d.add(2,0,'申請單資訊管理','',"",'');
               <%}
               if(user.hasAccess(roleList,"103")){%>
  d.add(3,0,'投訴管理','<html:rewrite page="/pages/client/cusComplain.jsp"/>',"",'rightFrame');
                <%}else{%>
                d.add(3,0,'投訴管理','',"",'');
                <%}
                if(user.hasAccess(roleList,"104")){%>
  d.add(4,0,'諮詢管理','inquire.html',"",'rightFrame');
                 <%}else{%>
                d.add(4,0,'諮詢管理','',"",'');
                <%}
                if(user.hasAccess(roleList,"105")){%>
  d.add(5,0,'結清管理','/rz/crm/clientSettleInitial.do',"",'rightFrame');
                <%}else{%>
                d.add(5,0,'結清管理','',"",'');
                <%}%>
  d.add(6,0,'報表管理');
                <%
                if(user.hasAccess(roleList,"106")){%>
  d.add(7,6,'預約交接報表','<html:rewrite page="/crm/connectReport.do"/>',"",'rightFrame');
                <%}else{%>
                d.add(7,6,'預約交接報表','','','rightFrame');
                <%}
                if(user.hasAccess(roleList,"107")){%>
  d.add(8,6,'業務情況統計報表','#','','');
                <%}else{%>
                d.add(8,6,'業務情況統計報表','','','rightFrame');
                <%}
                if(user.hasAccess(roleList,"108")){%>
  d.add(9,6,'諮詢情況統計報表','#','','');
                <%}else{%>
                d.add(9,6,'諮詢情況統計報表','','','rightFrame');
                 <%}
                if(user.hasAccess(roleList,"109")){%>
  d.add(10,6,'結清報表','#','','');
                <%}else{%>
                d.add(10,6,'結清報表','','','rightFrame');
                <%}
                if(user.hasAccess(roleList,"110")){%>
  d.add(11,6,'客服業績考核報表','#','','');
                <%}else{%>
                d.add(11,6,'客服業績考核報表','','','rightFrame');
                <%}%>
  document.write(d);

  //-->
 </script>

bankadd.java
    RZLogger log = new RZLogger();
        log.logDebug("Start executing action:" + actionMapping.getPath());
        log.logError(e.fillInStackTrace());
        messages.add(ActionMessages.GLOBAL_MESSAGE,
                     new ActionMessage("mm.add.bank.success"));
        super.saveMessages(httpServletRequest, messages);
        httpServletRequest.setAttribute(Const.NEXT_ACTION_KEY,
                                        "/pages/Market/bank/add.jsp");
        return actionMapping.findForward(Const.SUCCESS);

messgPage.jsp
 <html:messages id="message" message="true">
            <bean:write name="message"/>
 </html:messages>
            <%
            String nextAct = (String)request.getAttribute("next_action");
            if(null != nextAct){
            %>
   <SCRIPT LANGUAGE="JavaScript">
  function jump()
  {
                  document.location="<html:rewrite page='<%=nextAct%>'/>";
  }
 </SCRIPT>
                <input  type="button" value="確定" styleClass="botton_DS" onclick="jump()" c/>
             <!--html:button value="確定" property="Submit" onclick="document.location='<%=nextAct%>'"/-->
            <%}else{%>
             <html:button value="確定" property="Submit" onclick="history.back()"/>

            <%}%>

bankList.java
//設定第一個頁,並且初始化pager.
      List list = banDao.listBank();

      SimplePager pager = new SimplePager( (ArrayList) list,
                                          Const.ITEMS_PER_PAGE);
      httpServletRequest.getSession().setAttribute(bankPage.
          BANK_LIST_PAGER_KEY, pager);

      ActionForward forward = new ActionForward();
      String path = actionMapping.findForward(Const.SUCCESS).getPath() + "?" +
          Const.PAGE_KEY + "=1";
      forward.setPath(path);

bankPage.java
//轉到指定的頁,主要調用pager.gotopage();
      Pager pager = (Pager) httpServletRequest.getSession().getAttribute(BANK_LIST_PAGER_KEY);
      pager.gotoPage(requestPage);
      List curpage = pager.getCurrentPage();
      httpServletRequest.setAttribute(Const.PAGE_KEY,curpage);

      return actionMapping.findForward(Const.SUCCESS);

info.jsp
<td colspan="3" bgcolor="#FFFFFF" class=tr_02><html:text styleId="fddbr" styleClass="input02" name="dissupplierForm" property="silegrep"/></td>

list.jsp
  </tr>
  <%
                         int i=0;
                         Pager pager = (Pager)session.getAttribute("rz.supplier.list");
                       %>
  <logic:present name="page"> <logic:iterate id="supplierinf" name="page" indexId="index"  type="cn.rzdd.cbs.persistence.po.Supplierinf" > <logic:present name="supplierinf">
  <%
                            int curIndex = i + 1 + (pager.getCurrentPageIndex()-1) * pager.getCountPerPage() ;
                            i++;
                            request.setAttribute("indexd",new Integer(i));
                            if(curIndex%2==0){
                           %>
  <tr bgcolor="#EAEAEA">
    <%}else{%>
  <tr bgcolor="#F0F9FF">
    <%}%>
    <td><div align="center"> <bean:write name="indexd" /></div></td>
    <td height="25" ><div align="center"> <span class="button"><bean:write name="supplierinf" property="sisupname" />&nbsp;</span></div></td>
    <td><div align="center"><bean:write name="supplierinf" property="sirepresent" />&nbsp;</div></td>
    <td height="25"><div align="center"> <bean:write name="supplierinf" property="silegrep" />&nbsp;</div></td>
    <td ><div align="center"><html:link page="/mm/supplierInfo.do"  paramId="sid" paramName="supplierinf" paramProperty="siid">修改</html:link> &nbsp &nbsp <html:link page="/mm/supplierDelete.do"  paramId="sid" paramName="supplierinf" paramProperty="siid">刪除</html:link></div></td>
  </tr>
  </logic:present> </logic:iterate> </logic:present>
  <tr  class="tr_03">
    <td  height="30" colspan="9" align="right"><jsp:include page="/pages/pageNavigater.jsp" flush="false">
      <jsp:param name="action" value="supplierPage.do" />
      <jsp:param name="pagerName" value="rz.supplier.list"/>
      </jsp:include>
    </td>
  </tr>

pageNavigater.jsp
<%
   String pagerName = request.getParameter("pagerName");
   String action = request.getParameter("action");
%>
<logic:present name="<%=pagerName%>">
 <logic:greaterEqual name="<%=pagerName%>"  property="totalPages" value="0">
 轉到 <input type="text" class="goto" name="page" value='<bean:write name="<%=pagerName%>" property="currentPageIndex" />' onChange="gotoPage('<%=action%>',this.value)"/>
</logic:greaterEqual>

 <logic:equal name="<%=pagerName%>" property="hasPrior" value="true" >
  <a  href='javascript:priorPage("<%=action%>",<bean:write name="<%=pagerName%>" property="currentPageIndex" />)'>&lt;&lt;</a>
</logic:equal>
<logic:equal name="<%=pagerName%>" property="hasPrior" value="false" >
 &lt;&lt;
</logic:equal>

<bean:write name="<%=pagerName%>" property="currentPageIndex"/>/<bean:write name="<%=pagerName%>" property="totalPages"/>

  <logic:equal name="<%=pagerName%>" property="hasNext" value="true" >
     <a  href='javascript:nextPage("<%=action%>",<bean:write name="<%=pagerName%>" property="currentPageIndex" />)'>&gt;&gt;</a>
  </logic:equal>
  <logic:equal name="<%=pagerName%>" property="hasNext" value="false" >
   &gt;&gt;
  </logic:equal>
</logic:present>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.