posts - 4, comments - 10, trackbacks - 0, articles - 2

          2007年7月5日

          structs2 的 if標簽怎么做判斷???請各位幫幫看看!!!謝謝了.
          我在jsp里寫

           <s:label label="中文名" value="${artistVO.chineseName}"/>

          我要在頁面輸出"中文名"的時候,做一個判斷,就是中文名不是 "無"或"缺" 的時候再輸出.
          用<s:if test="">該怎么寫?
          structs2文檔里有一段關于<s:if test="">的例子

          <s:if test="'foo' in {'foo','bar'}">
             muhahaha
          </s:if>
          于是我照葫蘆畫瓢
           <s:if test="${'artistVO.chineseName' not in {'null','','無','缺','未知'}}">
           <s:label label="中文名" value="${artistVO.chineseName}"/>
          </s:if>

          沒有中文的時候還都正確,遇到中文的時候就不對了.這難道是中文問題嗎?


          posted @ 2007-07-05 16:39 samfree 閱讀(2037) | 評論 (2)編輯 收藏

          2007年4月23日

          我在用hibernate對mysql進行分頁的方法
          /**
            * 函數說明:獲得所有的信息
            * 參數說明:
            * 返回值:信息的集合
            */
           public List getProducts(final int pageSize, final int startRow) throws HibernateException { 
               return this.getHibernateTemplate().executeFind(new HibernateCallback(){

                   public Object doInHibernate(Session session) throws HibernateException, SQLException {
                  
                       Query query=session.createQuery("FROM Products as p");
                       query.setMaxResults(pageSize);
                       query.setFirstResult(startRow);    
              
                       List list = query.list();
                 
                       return list;
                   }
                  });

           }

          運行時怎么老給出異常阿?請幫幫我看看好嗎?
          org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
          org.hibernate.exception.SQLGrammarException: could not execute query
          java.sql.SQLException: Syntax error or access violation,  message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '40 products0_.game_id as game1_0_, products0_.game_name_en as game2_0_, products' at line 1"

          posted @ 2007-04-23 15:11 samfree 閱讀(2212) | 評論 (5)編輯 收藏

          2007年1月24日

          最近使用ant時,遇到了一個小難題,在一個名為冰浪的blog的提示下解決了.現在把它貼出來.
          首先判斷cvs下有沒有tag文件,如果有,就copy到當前目錄,如果沒有就調用java類創建,并寫入當前
          日期,然后在copy
          <condition property="exist.tag">?
          ????<and>?
          ????????<available file="Tag" filepath="CVS/"/>?
          ????</and>
          </condition>
          <target name="copytag" if="exist.tag">?
          ????<copy file="CVS/Tag" todir="temp"/>
          </target>
          <target name="createtag" unless="exist.tag" depends="copytag">?
          ????<java classname="com.xxx.pub.Tag">
          ????????<classpath>
          ????????????? <pathelement location="${build}"/>??????????
          ???????? </classpath>
          ????</java>
          ?<copy file="Tag" todir="temp" failonerror="false"/>
          </target>

          posted @ 2007-01-24 14:57 samfree 閱讀(1146) | 評論 (0)編輯 收藏

          2007年1月4日

          我現在做一個socket客戶端的接口,有這么一個問題。
          1,如果在30秒內接收到服務器端返回的消息,就認為是一次成功的連接。否則斷開此次連接
          2,采用短連接方式。即每次往服務器端發消息都建立一次連接
          3,每個發送請求最多允許3次連接。
          問題:怎樣判斷30秒內沒有接收到消息和收到消息時沒有超出30秒就斷開連接呢?
          ??????? 請給小弟一個思路吧。

          posted @ 2007-01-04 17:58 samfree 閱讀(986) | 評論 (3)編輯 收藏

          主站蜘蛛池模板: 辽中县| 镇宁| 竹北市| 威海市| 嵊泗县| 车险| 桂平市| 秦安县| 柘城县| 额敏县| 承德县| 巴东县| 晋江市| 祥云县| 灵寿县| 柞水县| 板桥市| 沐川县| 漳浦县| 汉沽区| 延川县| 普宁市| 屏南县| 沙雅县| 中山市| 外汇| 清水县| 西乌珠穆沁旗| 仁怀市| 宁武县| 新兴县| 合水县| 台前县| 南川市| 柯坪县| 绥德县| 阿图什市| 鲜城| 辽宁省| 衢州市| 丹江口市|