<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    JBOSS 點滴

    豐豐的博客

    #

    JAVA規范寫法

    更新某個對象時: 
    // 發布
     public String issue() throws Exception {
      String defineId = super.getRequest().getParameter("defineId");
      try {
       boolean isSuccess = false;
       // 修改
       if (defineId != null && !Utility.isEmpty(defineId)) {
        //更新某個字段時,先清空對象。
        fmDefine = new FmDefine();
        fmDefine.setDefineId(defineId);
        fmDefine.setState("已發布");
        isSuccess = fmDefineBO.update(fmDefine);
       }
       if (isSuccess) {
        super.addActionMessage("發布成功!");
       } else {
        super.addActionMessage("保存失敗!");
       }
    //   super.getRequest().setAttribute("isSuccess", isSuccess);
      } catch (Exception e) {
       e.printStackTrace();
      }
      return query();
     }

    posted @ 2013-08-15 15:11 半導體 閱讀(202) | 評論 (0)編輯 收藏

    文件上傳

             FileWriter writer;
             try {
              String path = System.getProperty("user.dir")+"/../webapps/sxzx/formfiles/"+session.get("objectID")+".txt";
                 writer = new FileWriter(path);
                 writer.write(content);
                 writer.flush();
                 writer.close();
             } catch (IOException e) {
                 e.printStackTrace();
             }

    posted @ 2013-08-15 11:30 半導體 閱讀(303) | 評論 (0)編輯 收藏

    數據庫最大連接數原理

    1、JAVA做一個循環,每做一次事務(CRUD)加一個連接,一個連接相當于占2M內存。
    50秒后自動釋放。
    如果超過最大連接數報錯如下:
    ORA-12519: TNS:no appropriate service handler found 解決  

    有時候連得上數據庫,有時候又連不上.

    可能是數據庫上當前的連接數目已經超過了它能夠處理的最大值.


    select count(*) from v$process --當前的連接數
    select value from v$parameter where name = 'processes' --數據庫允許的最大連接數
    修改最大連接數:
    alter system set processes = 300 scope = spfile;
    重啟數據庫:
    shutdown immediate;
    startup;
    --查看當前有哪些用戶正在使用數據
    SELECT osuser, a.username,cpu_time/executions/1000000||'s', sql_fulltext,machine
    from v$session a, v$sqlarea b
    where a.sql_address =b.address order by cpu_time/executions desc;

    連接數配置在:applicationcontext.xml中
    另一種解決辦法:直接用存儲過程,一個存儲過程只占一個連接。

    查看當前最大連接數:
    BasicDataSource dataSource = (BasicDataSource)SpringTools.getBean("dataSource");
    System.out.println(dataSource.getNumActive());

    posted @ 2013-08-14 17:07 半導體 閱讀(297) | 評論 (0)編輯 收藏

    myeclipse環境配置

    當myeclipse慢時,請查看以下原因:
    1、檢查:.project文件,去掉<nature>org.eclipse.wst.jsdt.core.jsNature</nature>。
        或:右鍵項目 -> properties -> Builders 去掉JavaScript Validator 前面的勾

    posted @ 2013-08-14 09:32 半導體 閱讀(181) | 評論 (0)編輯 收藏

    Jquery Eeay UI Validatebox 常用自定義效驗

         摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$.extend($.fn.validatebox.defaults.rules, {         ...  閱讀全文

    posted @ 2013-07-26 23:01 半導體 閱讀(278) | 評論 (0)編輯 收藏

    中文排序

    import java.text.Collator;
    import java.util.Arrays;


    public class Test2 {

        
    /**
         * 
    @param args
         
    */

        
    public static void main(String[] args) {
            
    // TODO Auto-generated method stub
            String[] names ={"王飛","李明","趙六"};
            Arrays.sort(names, Collator.getInstance(java.util.Locale.CHINA));
            System.out.println(Arrays.toString(names));

        }

    }

    posted @ 2013-07-26 22:39 半導體 閱讀(150) | 評論 (0)編輯 收藏

    輸出日志。myeclipse中

    1、在hibernate.cfg.xml中配置如下:
      <property name="hibernate.jdbc.batch_size">0</property>
      <property name="format_sql">false</property>
      <property name="use_sql_comments">false</property>
      
      <property name="show_sql">true</property>

    posted @ 2013-07-03 16:18 半導體 閱讀(224) | 評論 (0)編輯 收藏

    struct2.0語法

    字符串條件判斷:
       <s:if   test="%{#listD.genreId == '402881b73e11d5f5013e11dc118f000a'}">
    數字型判斷:
       <s:iterator value="list" id="listD" status="ind1">
       <s:if test="#ind1.getIndex()<=6"   >
    對象的取值方法:
            <s:iterator value="page" id="list" status="ind1">
          <s:iterator value="list" id="listD" status="ind1">
            <s:if test="#ind1.getIndex()<=5"   >
             <li> <a href="#"><span
               class="news">${listD.titleName}</span> </a> <span class="right"><s:date
                name="issueDate" format="yyyy-MM-dd" /> </span>
           </s:if>
          </s:iterator>
         </s:iterator>
    在一個頁面重復取list對象(不要id,,var,status):
            <s:iterator value="#list">
          <s:if test="%{genreId == '402881b73e11d5f5013e11dd21ea000c'}">
           <li><a href="../opt/PortalInfoDAction_queryContent.do?detailId=${detailId}"><span class="news">${titleName}</span> </a>
            <span class="right"><s:date name="issueDate"
              format="yyyy-MM-dd" /> </span>
          </s:if>
         </s:iterator>
    sql條件的取值方法:
    <s:iterator value="#a19list" var="a19list" status="ind1">
               <s:if test="#ind1.getIndex()<4">
               <li>
                <a
                 href="<c:url value="/web/WebHomeAction_content.do?detailId=${detailId}"/>">${titleName}</a>
               </li>
              </s:if>
             </s:iterator>

    判斷大小: <s:property value="sysRegisterList.size()"/>

    下拉框獲取值:            
    <select id="radioName" name="radioName"    >
        <c:forEach var="sysobject" items="${session.sysobject }" >
          <option name="" value="${sysobject.englishNames}" typeCode="${sysobject.dictName}" >${sysobject.chnName}</option>
       </c:forEach>
       </select> 
    session取值:
    JAVA中:ActionContext.getContext().getSession().put("sum2", (String)sumObject[1]);
    取值:${session.sum2}

    在struts中用#來訪問ActionContext中的對象。

    posted @ 2013-05-14 17:15 半導體 閱讀(188) | 評論 (0)編輯 收藏

    樣式表學習

    1、文字太長,加省略號。
    li{
      white-space:nowrap;
      text-overflow:ellipsis;
      -o-text-overflow:ellipsis; /*opera*/
      overflow: hidden;
     }

    posted @ 2013-05-14 16:33 半導體 閱讀(155) | 評論 (0)編輯 收藏

    jerichoTab 加載完默認選中最后一個,如何讓他選擇第一個

    第一步:

    改代碼吧。 改文件jquery.jerichotab.js 第205行, 原為

    .animate({ 'opacity': '1', width: opts.tabWidth }, function() {

    $.fn.setTabActive(curIndex);

    });

    直接刪除205行,或注解掉205行

    //$.fn.setTabActive(curIndex);
    第二步:改JSP頁面
         把activeTabIndex:1改為activeTabIndex:0

    posted @ 2013-05-03 15:56 半導體 閱讀(749) | 評論 (1)編輯 收藏

    僅列出標題
    共27頁: First 上一頁 5 6 7 8 9 10 11 12 13 下一頁 Last 
    主站蜘蛛池模板: 在线人成免费视频69国产| 一级毛片免费观看| 久久精品免费大片国产大片| 久久中文字幕免费视频| 国产精品久久久亚洲| 亚洲国产区男人本色| 伊人久久免费视频| 亚洲一区二区三区夜色| 无码色偷偷亚洲国内自拍| 无码A级毛片免费视频内谢| 亚洲成AV人片一区二区密柚| 久久青草免费91线频观看站街| 国产免费av一区二区三区| 亚洲视频网站在线观看| 国产成人无码精品久久久免费| 99精品全国免费观看视频| 久久亚洲精品成人综合| 免费福利在线观看| 日韩精品无码区免费专区| 亚洲男同gay片| 久久久www成人免费毛片| 亚洲字幕AV一区二区三区四区| 16女性下面无遮挡免费| 亚洲大尺度无码专区尤物| 一区二区在线免费观看| 亚洲一区二区三区高清视频| 久草免费手机视频| 亚洲一区二区三区不卡在线播放| 精品久久免费视频| 亚洲色中文字幕在线播放| 国产又粗又长又硬免费视频| 亚洲国产aⅴ成人精品无吗| 哒哒哒免费视频观看在线www| 亚洲中文精品久久久久久不卡| 免费国产综合视频在线看| 国产日韩AV免费无码一区二区 | 日本在线观看免费高清| 久久久久久久综合日本亚洲| 波多野结衣免费在线| 亚洲成在人线电影天堂色| 蜜桃AV无码免费看永久|