struts2遍历select
生活随笔
收集整理的這篇文章主要介紹了
struts2遍历select
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
<s:bean name="org.apache.struts2.util.Counter" id="counter"> <s:param name="first" value="1" /> <s:param name="last" value="pageCount" /> <s:iterator> <s:if test="current==curPage"> <option selected="selected"> <s:property /> </option> </s:if> <s:else> <option> <s:property /> </option> </s:else> </s:iterator> </s:bean> 批量插入(Batch ? inserts)?如果要將很多對象持久化,你必須通過經常的調用 ? flush() ? 以及稍后調用 ? clear() ? 來控制第一級緩存的大小。?
Session ? session ? = ? sessionFactory.openSession();? Transaction ? tx ? = ? session.beginTransaction();? for ? ( ? int ? i=0; ? i <100000; ? i++ ? ) ? {? Customer ? customer ? = ? new ? Customer(.....);? session.save(customer);? if ? ( ? i ? % ? 20 ? == ? 0 ? ) ? { ? //20, ? same ? as ? the ? JDBC ? batch ? size ? //20,與JDBC批量設置相同? //flush ? a ? batch ? of ? inserts ? and ? release ? memory:? //將本批插入的對象立即寫入數據庫并釋放內存? session.flush();? session.clear();? }? }? tx.commit();? session.close();? -------------------------? 因為你采用的是聲明式事務,那就可以不用管session和transaction的打開關閉問題。session實例可以通過Dao的getSession()或sessionFactory.getCurrentSession()獲得。
轉載于:https://my.oschina.net/xiahuawuyu/blog/42565
總結
以上是生活随笔為你收集整理的struts2遍历select的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Bitmap 之 getPixels()
- 下一篇: 梦到前男友和自己复合了是什么意思