JSP頁面常用

來源:互聯網
上載者:User

開啟頁面

<form action="${ctx}/ims/addInvoiceInfo.action" method="post"   class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">

onsubmit="return validateCallback(this, dialogAjaxDone);"彈出

onsubmit="return validateCallback(this, navTabAjaxDone);"標籤開啟

分頁

<form id="pagerForm" rel="invoice_invalid_div" method="post" action="${ctx}/ims/invoice/findInvoiceInfoList.action">
 <tangs:pagesHead pageNum="1" numPerPage="${pager.numPerPage}" orderField="${pager.orderField}" orderValue="${pager.orderValue}"/>

rel="invoice_invalid_div" 重新整理DIV

<tangs:pagesBoot targetType="navDiv" numPerPage="${pager.numPerPage}" totalCount="${pager.totalCount}" pageNumShown="90" currentPage="${pager.currentPage}"/> 

targetType="navDiv" 重新整理DIV

targetType="navTab" 重新整理頁面

 

頁面取資料

 <s:iterator value="exchangeInfo.excDetailInfo"  id="excDetail" status="status">

序號

<s:property value='#status.index'/>

取資料

${excDetail.gunNo}或<s:property value='#excDetail.gunNo'/>

取參數

HttpServletRequest request = ServletActionContext.getRequest();
  String rid=request.getParameter("roleid");

<input type="hidden" id="roleid" name="roleid" value="${param.roleid}"/>

頁面取數組資料

<s:iterator value="groupselect" status="status">
                   <tr target="groupid" rel="<s:property value="groupselect[#status.index][0]" />" > 
                   <td><input type="checkbox" group="id" class="checkboxCtrl" checked="checked"></td>
                 <td ><s:property value="groupselect[#status.index][1]" /></td>    
      <td ><s:property value="groupselect[#status.index][2]" /></td>
        </tr>
    </s:iterator>

list資料轉換取值

 actionlist =actionService.find("select m.resourceid,a.actionname from ActionInfo a ,MenuResourcesInfo m where a.actionid=m.actionid and a.status=0 and m.status=0 and m.menuid="+menuid+"");//查詢功能菜單
    Iterator iter=actionlist.iterator();
    for(;iter.hasNext();)
    {
    Object[] ob=(Object[])iter.next();
    String name=ob[1].toString();
     String id=ob[0].toString();

 }

//取兩表中的一個ID

List<MenusInfo> menlist=menusInfoService.find("select m.menuid from MenusInfo m,RightsForRolesInfo r where m.menuid=r.rightid and m.status=0 and r.status=0 and r.righttype=0 and r.roleid="+RoleId+"");
   int len=menlist.size();
   String[] arr = (String[])menlist.toArray( new String[menlist.size()]);      
   for(int i=0;i<len;i++)
   {
    String getid=arr[i].toString();
    menumap.put(getid,getid);  
   }

//直接取資料

 for(MenusInfo m:milist)
   {   
    String name=m.getCname();//取資料

}

 

 

 

 

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.