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

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

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

    無(wú)聊人士

    搬家==》www.soapui.cn

      BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      32 隨筆 :: 0 文章 :: 60 評(píng)論 :: 0 Trackbacks

    2006年9月13日 #

    struts 2.0.6GA開(kāi)始試螃蟹,照著struts2的tag文檔寫(xiě)成<@s.datetimepicker/>,結(jié)果老是報(bào)錯(cuò)
    211672?[http-8080-Processor25]?ERROR?freemarker.runtime??-?
    on?line?
    7,?column?17?in?admin/index.ftl?s.datetimepicker?not?found.
    The?problematic?instruction:
    ----------
    ==>?user-directive?s.datetimepicker?[on?line?7,?column?17?in?admin/index.ftl]
    ----------

    Java?backtrace?for?programmers:
    ----------
    freemarker.core.InvalidReferenceException:?on?line?
    7,?column?17?in?admin/index.ftl?s.datetimepicker?not?found.

    試著google一下,正好有人也提交了這個(gè)bug,改成 <@s.dateTimePicker />,問(wèn)題解決

    The?fix?is?as?follows:

    In?struts2-core-
    2.0.6:
    org.apache.struts2.views.freemarker.tags.StrutsModels

    has?a?method
    getDateTimePicker()

    Which?should?be?re-named:
    getDatetimepicker()

    to?match?with?the?naming?convention.


    hello,struts2.jpg
    posted @ 2007-04-20 10:26 mmwy 閱讀(2597) | 評(píng)論 (0)編輯 收藏

    來(lái)自:http://www.javaworld.com.tw/jute/post/print?bid=11&id=166588

    3.Re:BIRT報(bào)表工具的問(wèn)題?[Re:?uxa]?????Copy?to?clipboard
    Posted?by:?uxa
    Posted?on:?
    2006-09-15?15:28

    經(jīng)過(guò)幾次的失敗後~~小弟終於試出來(lái)了
    不過(guò)感覺(jué)它似乎只是support?xls?file?format並沒(méi)有excel的一些功能>?<

    1.?download?eclipse?plugin?BIRT,小弟抓的是birt-report-designer-all-in-one-2_1_0.zip
    將其解開(kāi)後把eclipse\plugins和eclipse\features這兩個(gè)目錄放到eclipse的目錄底下
    現(xiàn)在將eclipse打開(kāi),您已經(jīng)可以開(kāi)始設(shè)計(jì)報(bào)表了。

    2.?BIRT預(yù)設(shè)有支援HTML和PDF的格式,以下說(shuō)明如何支援xls格式
    a.?download?xls-emitter-bin_2
    .1.0.zip,解開(kāi)後將plugins複製到eclipse\plugins下
    b.?download?poi-bin-
    3.0-alpha2-20060616.zip,解開(kāi)後將jar檔複製到eclipse\plugins\?org.uguess.birt.report.engine.emitter.xls_2.1.0.200607031206\lib
    c.?xls-emitter-bin_2
    .1.0.zip解開(kāi)後有個(gè)path的目錄,
    (
    1)?將org.eclipse.birt.report.designer.ui目錄下的檔案複製到eclipse\plugins\org.eclipse.birt.report.designer.ui.preview_2.1.0.*.jar
    (
    2)將org.eclipse.birt.report.viewer目錄下的檔案複製到eclipse\plugins\?org.eclipse.birt.report.viewer_2.1.0.*\birt\WEB-INF\lib\viewservlets.jar
    (
    3)將org.eclipse.birt.report.engine目錄下的檔案複製到eclipse\plugins\org.eclipse.birt.report.engine_2.1.0.*.jar

    完成後啟動(dòng)eclipse可看到在view?report的按鈕上多了xls和ppt兩種格式

    BIRT下載位置:http://download.eclipse.org/birt/downloads/
    Tribix下載位置:https://sourceforge.net/projects/tribix
    ps:請(qǐng)注意版本的問(wèn)題,BIRT2
    .1.0請(qǐng)搭配Tribix?XLS?Emitter?2.1.0版本,在置換檔名的部份也請(qǐng)注意路徑是否正確

    posted @ 2007-04-08 15:42 mmwy 閱讀(1625) | 評(píng)論 (2)編輯 收藏

    條碼顯示,在birt中最常見(jiàn)的有兩種方法:1、使用條碼字體(對(duì)pdf無(wú)效);2、用barcode的開(kāi)源包,生成barcode,然后在報(bào)表里用動(dòng)態(tài)地址去取圖片。

    今晚看birt文檔(第 23 章 使用 Java 編寫(xiě)事件處理程序),例子中用java實(shí)現(xiàn)了一個(gè)LabelEventAdapter的適配器,對(duì)標(biāo)簽元素進(jìn)行事件控制。腦子里靈光一現(xiàn),似乎條碼有著落了。

    我的測(cè)試?yán)雍芎?jiǎn)單,繼承ImageEventAdapter類(lèi),重載onCreate方法,以進(jìn)行條形碼處理

    ?1?package?cn.ynzc.common.birt.test;
    ?2?
    ?3?import?java.io.File;
    ?4?import?java.io.FileOutputStream;
    ?5?
    ?6?import?jbarcodebean.Code128;
    ?7?import?jbarcodebean.JBarcodeBean;
    ?8?
    ?9?import?org.apache.commons.codec.digest.DigestUtils;
    10?import?org.eclipse.birt.report.engine.api.script.IReportContext;
    11?import?org.eclipse.birt.report.engine.api.script.eventadapter.ImageEventAdapter;
    12?import?org.eclipse.birt.report.engine.api.script.instance.IImageInstance;
    13?
    14?public?class?MyLabelClass?extends?ImageEventAdapter?{
    15?
    16???public?void?onCreate(IImageInstance?image,?IReportContext?reportContext)?{
    17?????try?{
    18???????//實(shí)際應(yīng)用中,可以使用image.getRowData().getColumnValue("columnname")獲得字段值
    19???????String?code?=?"ABCDEF123-2222";
    20???????//似乎windows文件名中不允許使用“-”等符號(hào),干脆將code進(jìn)行md5散列處理
    21???????File?file?=?new?File(System.getProperty("java.io.tmpdir"),?DigestUtils.md5Hex(code));
    22???????//避免每次都進(jìn)行條碼文件生成
    23???????if?(!file.exists())?{
    24?????????JBarcodeBean?bb?=?new?JBarcodeBean();
    25?????????bb.setCodeType(new?Code128());
    26?????????bb.setShowText(true);
    27?????????bb.setBarcodeHeight(45);?//條碼高度
    28?????????bb.setCode(code);
    29?????????bb.gifEncode(new?FileOutputStream(file));
    30???????}
    31???????image.setFile(file.getAbsolutePath());
    32?????}
    33?????catch?(Exception?e)?{
    34???????e.printStackTrace();
    35?????}
    36???}
    37?
    38?}
    39?

    測(cè)試用的birt報(bào)表文件簡(jiǎn)單得要死,就往上面扔了個(gè)image元素,設(shè)置其Event Handler Class為剛才寫(xiě)好的java類(lèi),最終得到的rptdesign文件內(nèi)容如下:
    ?1?<?xml?version="1.0"?encoding="UTF-8"?>
    ?2?<!--?Written?by?Eclipse?BIRT?2.0?-->
    ?3?<report?xmlns="http://www.eclipse.org/birt/2005/design"?version="3.2.6"?id="1">
    ?4?????<property?name="createdBy">Eclipse?BIRT?Designer?Version?2.1.2.v20070205-1728?Build?&lt;20070205-1728></property>
    ?5?????<property?name="units">in</property>
    ?6?????<page-setup>
    ?7?????????<simple-master-page?name="Simple?MasterPage"?id="2"/>
    ?8?????</page-setup>
    ?9?????<body>
    10?????????<image?id="4">
    11?????????????<property?name="eventHandlerClass">cn.ynzc.common.birt.test.MyLabelClass</property>
    12?????????</image>
    13?????</body>
    14?</report>

    運(yùn)行測(cè)試,條形碼出來(lái)了
    birt.jpg

    遺留問(wèn)題:
    這次是調(diào)用org.eclipse.birt.report.engine.api.script.instance.IImageInstance.setFile()來(lái)解決問(wèn)題,從javadoc可以看到,IImageInstance有很多方法可以調(diào)用,其它方法分別有什么作用?比如我嘗試了半天的setData(byte[])方法,一開(kāi)始以為是用這個(gè)方法直接把圖形數(shù)據(jù)set進(jìn)去就ok,結(jié)果未成功。


    posted @ 2007-04-07 03:37 mmwy 閱讀(4231) | 評(píng)論 (4)編輯 收藏

    birt的IRunAndRenderTask接口提供了addScriptableJavaObject(java.lang.String jsName, java.lang.Object obj)方法,利用這個(gè)方法,在直接調(diào)用birt api操作處理報(bào)表的時(shí)候,我們可以將任何java對(duì)象通過(guò)addScriptableJavaObject("xxx",Object)加進(jìn)birt去,然后在birt腳本中直接調(diào)用xxx.method()進(jìn)行操作。

    我的測(cè)試是在一個(gè)webwork+spring+hibernate的webapp應(yīng)用中進(jìn)行的,進(jìn)行報(bào)表處理的代碼參照http://wiki.eclipse.org/index.php/Servlet_Example編寫(xiě),在代碼中,寫(xiě)了一句
    task.addScriptableJavaObject("ctx",
    WebApplicationContextUtils.getWebApplicationContext(sc));

    birt中定義了一個(gè)scripts datasource,然后定義一個(gè)data set,在dataset的open方法中編寫(xiě)腳本

    infoManager=ctx.getBean("infoManager");
    infos=infoManager.loadAll();
    ...
    posted @ 2007-04-06 15:39 mmwy 閱讀(2066) | 評(píng)論 (3)編輯 收藏

    在apache網(wǎng)站上已經(jīng)有很詳細(xì)的介紹
    http://tomcat.apache.org/connectors-doc/reference/iis.html

    有幾點(diǎn)注意的:
    1、除了照文檔的例子在注冊(cè)表"HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0"建相應(yīng)鍵值外,還可以在isapi_redirect.dll所在的目錄建“isapi_redirect.properties”文件。

    2、extension_uri=/jakarta/isapi_redirect.dll
    這個(gè)extension_uri寫(xiě)成什么路徑,就得在iis站點(diǎn)中建相應(yīng)名字的虛擬目錄(執(zhí)行權(quán)限),以保證/jakarta/isapi_redirect.dll能被正常訪問(wèn)到。

    3、除文檔上介紹的幾大步(注冊(cè)表、網(wǎng)站、虛擬路徑等)以外,win2003 iis上還得做下面這個(gè)步驟

    新建應(yīng)用程序擴(kuò)展
    在IIS管理器左側(cè)網(wǎng)站下面選中Web服務(wù)擴(kuò)展,添加一個(gè)新的Web服務(wù)擴(kuò)展,擴(kuò)展名為jakarta,添加要求得文件為D:\Tomcat5.0\bin\jakart\isapi_redirect.dll,并設(shè)置擴(kuò)展?fàn)顟B(tài)為允許。
    (注:來(lái)自 http://www.cnrui.cn/blog/article.asp?id=179




    posted @ 2007-03-19 15:39 mmwy 閱讀(1835) | 評(píng)論 (2)編輯 收藏



    選中table的detail行,切換到script標(biāo)簽,在onPrepare事件中輸入
    ?
    count=1;

    在onCreate事件中輸入
    1count++;
    2this.getStyle().backgroundColor=(count%2==0?"red":"blue");

    或是直接打開(kāi)xml source,在相應(yīng)的detail位置上修改源碼為
    ????????????????<detail>
    ??????????????????
    <row?id="66">
    ????????????????????.
    ????????????????????
    <method?name="onPrepare"><![CDATA[count=1;]]></method>
    ????????????????????
    <method?name="onCreate"><![CDATA[count++;this.getStyle().backgroundColor=(count%2==0?"red":"blue");]]></method>
    ????????????????????..

    xxxxx.jpg

    posted @ 2006-11-24 01:04 mmwy 閱讀(1881) | 評(píng)論 (0)編輯 收藏

    定義報(bào)表參數(shù):

    3.jpg



    解決方法一:

    1.jpg


    2.jpg



    解決辦法二:

    在報(bào)表空白處點(diǎn)擊一下,然后切換到script標(biāo)簽,選擇beforeFactory。

    4.jpg


    posted @ 2006-11-23 01:48 mmwy 閱讀(3286) | 評(píng)論 (0)編輯 收藏

    筆記一下:

    設(shè)hibernate.hbm2ddl.auto為update/create-drop/create后,在classpath中扔一個(gè)/import.sql進(jìn)去,hibernate啟動(dòng)時(shí)就會(huì)執(zhí)行import.sql的內(nèi)容。

    11860 [main] INFO? org.hibernate.tool.hbm2ddl.SchemaExport? - Running hbm2ddl schema export
    11860 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaExport? - import file not found: /import.sql
    11875 [main] INFO? org.hibernate.tool.hbm2ddl.SchemaExport? - exporting generated schema to database
    posted @ 2006-10-31 00:32 mmwy 閱讀(5764) | 評(píng)論 (2)編輯 收藏

    使用的安裝包:
    ?1?cronolog-1.6.2.tar.gz??????????????????????????????
    ?2httpd-2.0.59.tar.gz????????????????????????????????
    ?3instantclient-basic-linux32-10.2.0.2-20060331.zip??
    ?4instantclient-sdk-linux32-10.2.0.2-20060331.zip????
    ?5libmcrypt-2.5.7.tar.gz?????????????????????????????
    ?6mhash-0.9.7.1.tar.gz???????????????????????????????
    ?7mysql-3.23.58.tar.gz???????????????????????????????
    ?8php-4.4.4.tar.gz????

    參考文檔

    1. 為 Linux 和 Windows 安裝 PHP 和 Oracle 10g Instant Client
    2. Connecting to Oracle10g from PHP using OCI-8 (Linux)
    與文檔有出處的地方
    1. otn上只能下到zip格式的oracle 10g instant client basic和sdk包。解壓縮后,全部放到instantclient_10_2目錄下。
      [root@localhost?sdk]#?ls?-l?..
      total?
      115948
      -r--r--r--??
      1?root?root??1594191?Feb??5??2006?classes12.jar
      -rwxrwxr-x??
      2?root?root?18774535?Feb??5??2006?libclntsh.so
      -rwxrwxr-x??
      2?root?root?18774535?Feb??5??2006?libclntsh.so.10.1
      -r-xr-xr-x??
      1?root?root??5623929?Feb??5??2006?libnnz10.so
      -rwxrwxr-x??
      1?root?root??1398088?Feb??5??2006?libocci.so.10.1
      -rwxrwxr-x??
      1?root?root?70690282?Feb??5??2006?libociei.so
      -r-xr-xr-x??
      1?root?root???119919?Feb??5??2006?libocijdbc10.so
      -r--r--r--??
      1?root?root??1540457?Feb??5??2006?ojdbc14.jar
      drwxr-xr-x??
      4?root?root?????4096?Oct?17?04:27?sdk
      [root@localhost?sdk]#?ls?-l
      total?
      324
      drwxr-xr-x??
      2?root?root???4096?Oct?17?04:27?demo
      drwxr-xr-x??
      2?root?root???4096?Oct?17?04:27?include
      -r-xr-xr-x??
      1?root?root????346?Oct?17?04:27?ott
      -rw-r--r--??
      1?root?root?298274?Oct?17?04:27?ottclasses.zip
    2. php4.4.4已經(jīng)提供了--with-oci8-instant-client參數(shù)的支持,同時(shí)修復(fù)了相關(guān)補(bǔ)丁,因此,文檔中為php打補(bǔ)丁、重建“configure”腳本的步驟可以省略。
    環(huán)境變量:
    1. 在LD_LIBRARY_PATH中添加oracle 10g instant client的路徑。
      export?LD_LIBRARY_PATH=/www/server/instantclient_10_2/:${LD_LIBRARY_PATH}
    2. 設(shè)置TNS_ADMIN為oracle tnsname.ora文件所在目錄。
      export?TNS_ADMIN=/u01/app/oracle/product/10g/network/admin/
    編譯腳本
    ./configure \
    --prefix
    =/www/server/php-4.4.4 \
    --with-apxs2
    =/www/server/httpd-2.0.59/bin/apxs \
    --with-mysql
    =/www/server/mysql-3.23.58 \
    --with-mcrypt
    =/www/server/libmcrypt-2.5.7 \
    --with-mhash
    =/www/server/mhash-0.9.7.1 \
    --with-gd?--with-zlib \
    --with-oci8-instant-client
    =/www/server/instantclient_10_2
    注:需要使用ln命令為libclntsh.so.10.1創(chuàng)建一個(gè)名為libclntsh.so的連接,否則在configure過(guò)程中將會(huì)出現(xiàn)error:Link xxxx not found的錯(cuò)誤。(http://forums.oracle.com/forums/thread.jspa?messageID=1203218&#1203218

    測(cè)試
    1. 安裝成功的話,在phpinfo()信息中可以看到相應(yīng)信息
      OCI8?Support????????????????? enabled
      Revision????????????????????? $Revision:?
      1.183.2.18.2.3?$
      Oracle?Version???????????????
      10.1
      Compile-time?ORACLE_HOME????? /www/server/instantclient_10_2
      Libraries?Used??????????????? no?value
    2. 測(cè)試代碼
      ?1?<?php?
      ?2?$conn?=?OCILogon("username",?"password",?"//127.0.0.1:1521/sid");
      ?3?$query?=?'select?table_name?from?user_tables';
      ?4?$stid?=?OCIParse($conn,?$query);
      ?5?OCIExecute($stid,?OCI_DEFAULT);
      ?6?
      ?7?while?($succ?=?OCIFetchInto($stid,?$row))?{
      ?8?????foreach?($row?as?$item)?{
      ?9?????????echo?$item."?";
      10?????????}
      11?????echo?"<br>\n";
      12??}
      13?OCILogoff($conn);
      14??>


    posted @ 2006-10-15 02:46 mmwy 閱讀(1336) | 評(píng)論 (1)編輯 收藏

    最近在“玩”hibernate Annotation,弄了個(gè)Attachment保存進(jìn)數(shù)據(jù)庫(kù)的測(cè)試,附件內(nèi)容保存在content屬性里面。
    ??@Lob
    ??@Column(columnDefinition?
    =?"LongBlob")
    ??
    public?byte[]?getContent()?{
    ????
    return?content;
    ??}
    一開(kāi)始,配置mysql jdbc url如下
    jdbc.url????????????=????jdbc:mysql://localhost/test\
    ?????????????????????????????useUnicode
    =true\
    ????????????????????????????&characterEncoding
    =gbk
    一測(cè)試,報(bào)錯(cuò)
    Caused?by:?java.sql.BatchUpdateException:?Syntax?error?or?access?violation?message?from?server:?"You?have?an?error?in?your?SQL?syntax?near?''D0CF11E0A1B11AE1000000000000000000000000000000003E000300FEFF0900060000000000000'?at?line?1"
    ????at?com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:
    1540)
    同樣的語(yǔ)句,直接在mysql命令行下運(yùn)行就沒(méi)問(wèn)題,偏偏jdbc上就有這臭毛病。換jdbc driver版本,改@Lob為 @Type(type = "org.springframework.orm.hibernate3.support.BlobByteArrayType"),改hibernate配置(比如hibernate.jdbc.use_streams_for_binary true),甚至是直接用jdbc來(lái)insert,亂七八糟折騰半天,問(wèn)題照舊。最后只好用上“歪”招,把byte[]配成String,在保存的時(shí)候把byte[]保存成hex String格式,取的時(shí)候再解碼回來(lái)。

    歪招終歸是歪招,這兩天老為這東西心煩,晚上吃飯的時(shí)候無(wú)意中想起charset的問(wèn)題,把代碼撿回來(lái)再測(cè)試了一下,問(wèn)題解決,哈哈!
    jdbc.url????????????=????jdbc:mysql://localhost/mmwy_blog\
    ?????????????????????????????useUnicode
    =true\
    ????????????????????????????&characterEncoding
    =utf-8
    如果設(shè)成iso-8859-1、utf-8,保存一點(diǎn)問(wèn)題都沒(méi)有,換用gbk、gb2312、big5之類(lèi)的字符集,問(wèn)題就出來(lái)了。

    posted @ 2006-10-12 15:54 mmwy 閱讀(1767) | 評(píng)論 (1)編輯 收藏

    最近開(kāi)始嘗試hibernate annotations,終于成功的將手上一個(gè)小應(yīng)用轉(zhuǎn)為annotations :)

    1、spring orm support
    與原來(lái)使用LocalSessionFactoryBean相比,變動(dòng)不大(AnnotationSessionFactoryBean本來(lái)就是從LocalSessionFactoryBean類(lèi)繼承過(guò)來(lái)的嘛)
    ?1????<bean
    ?2?????????id="sessionFactory"
    ?3?????????class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
    ?4?????????parent="AbstractSessionFactory">
    ?5?????????<property?name="annotatedClasses">
    ?6?????????????<list>
    ?7?????????????????<value>xxx.xxx.xxx.domain.Account</value>
    ?8?????????????</list>
    ?9?????????</property>
    10?????</bean>
    11?????<bean
    12?????????id="AbstractSessionFactory"
    13?????????class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
    14?????????abstract="true">
    15?????????<property
    16?????????????name="dataSource"
    17?????????????ref="DataSource"?/>
    18?????????<property?name="hibernateProperties">
    19?????????????<props>
    20?????????????????<prop?key="hibernate.dialect">${hibernate.dialect}</prop>
    21?????????????????<prop?key="hibernate.show_sql">${hibernate.show_sql}</prop>
    22?????????????????<prop?key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
    23?????????????????<prop?key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
    24?????????????????<prop?key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
    25?????????????</props>
    26?????????</property>
    27?????????<property
    28?????????????name="lobHandler"
    29?????????????ref="DefaultLobHandler"?/>
    30?????</bean>
    2、id的配置
    非常簡(jiǎn)單,在id的getter上面加個(gè)“@Id”就可以了。此時(shí)采用的id策略是javax.persistence.GenerationType.AUTO,也可以再加上“@GeneratedValue(generator =GenerationType.IDENTITY|GenerationType.SEQUENCE|GenerationType.TABLE)”換成其它策略。
    我的應(yīng)用采用的是hibernate的uuid策略,就不得不在這兒使用hibernate的擴(kuò)展了
    ??@Id
    ??@Column(length?
    =?32)
    ??@GeneratedValue(generator?
    =?"system-uuid")
    ??@GenericGenerator(name?
    =?"system-uuid",?strategy?=?"uuid")

    3、級(jí)聯(lián)策略
    在ejb3-persistence.jar中只定義了ALL、MERGE、PERSIST、REFRESH、REMOVE,比較惡心的就是,刪除對(duì)象的時(shí)候,并不會(huì)級(jí)聯(lián)刪除關(guān)聯(lián)對(duì)象,而是用update xx set parent_id=null where parent_id=?這類(lèi)語(yǔ)句把關(guān)系干掉了事。不得已,在這兒用了hibernate的DELETE_ORPHAN。
    ??@OneToMany(targetEntity?=?Attachment.class)
    ??@Cascade(value?
    =?{org.hibernate.annotations.CascadeType.DELETE_ORPHAN,
    ??????org.hibernate.annotations.CascadeType.ALL})
    ??@JoinColumn(name?
    =?"info_id")
    4、CACHE
    ejb3-persistence.jar里面沒(méi)有找到cache的配置,繼續(xù)請(qǐng)出hibernate來(lái)干活
    import?org.hibernate.annotations.Cache;
    import?org.hibernate.annotations.CacheConcurrencyStrategy;

    @Entity
    @Table(name?
    =?"T_INFO")
    @Cache(usage?
    =?CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
    5、自定義字段類(lèi)型
    我的POJO中有一個(gè)private String content;的屬性,按ejb3配成@Lob后,被處理成了text類(lèi)型,text 64k的存儲(chǔ)容量還是比較可憐了。
    ??@Lob
    ??@Column(columnDefinition?
    =?"LongText")

    posted @ 2006-10-12 15:38 mmwy 閱讀(4887) | 評(píng)論 (0)編輯 收藏

    以如下字符串為例:
    <h1>AVG?Internet?Security?full?license?free?of?charge!</h1>
    <p>GRISOFT
    ,?the?supplier?of?AVG?security?software,?has?released?the?Public?Beta?2?version?of?the?upcoming?AVG?7.5?edition.?Individual?programs?are?now?available?for?testing?purposes?to?everyone.?Why?not?participate?in?our?AVG?beta?testing,?complete?the?questionnaire?about?testing?AVG?7.5?and?get?a?free?license??We?will?draw?100?participants?from?all?of?the?received?feedback?forms.?Winners?will?obtain?a?two-year?license?for?AVG?Internet?Security?7.5?completely?free?of?charge.</p>
    使用RichTextEditor進(jìn)行編輯時(shí),產(chǎn)生的html有oFCKeditor_InfoEdit_model_content.Value = 'xxx'字樣,由于字符串中包含單引號(hào)、雙引號(hào)、換行符等字符,編輯器無(wú)法進(jìn)行處理,瀏覽器控制臺(tái)報(bào)js錯(cuò)誤。

    在freemarker中提供了一個(gè)StringUtil工具,在使用RichTextEditor前,應(yīng)使用StringUtil.javaStringEnc()進(jìn)行預(yù)處理。
    posted @ 2006-09-25 12:05 mmwy 閱讀(830) | 評(píng)論 (1)編輯 收藏

    用webwork 2.2.4、sitemesh 2.2.1、freemarker 2.3.8,操作系統(tǒng)為winxp pro sp2.

    web.xml配置大致如下:

    ?1 ???? < filter >
    ?2 ???????? < filter-name > encodingFilter </ filter-name >
    ?3 ???????? < filter-class > com.yninfo.rules.web.util.CharacterEncodingFilter </ filter-class >
    ?4 ???????? < init-param >
    ?5 ???????????? < param-name > encoding </ param-name >
    ?6 ???????????? < param-value > UTF-8 </ param-value >
    ?7 ???????? </ init-param >
    ?8 ???????? < init-param >
    ?9 ???????????? < param-name > forceEncoding </ param-name >
    10 ???????????? < param-value > true </ param-value >
    11 ???????? </ init-param >
    12 ???? </ filter >
    13 ???? < filter >
    14 ???????? < filter-name > webwork-cleanup </ filter-name >
    15 ???????? < filter-class > com.opensymphony.webwork.dispatcher.ActionContextCleanUp </ filter-class >
    16 ???? </ filter >
    17 ???? < filter >
    18 ???????? < filter-name > sitemesh </ filter-name >
    19 ???????? < filter-class > com.opensymphony.webwork.sitemesh.FreeMarkerPageFilter </ filter-class >
    20 ???? </ filter >
    21 ???? < filter >
    22 ???????? < filter-name > webwork </ filter-name >
    23 ???????? < filter-class > com.opensymphony.webwork.dispatcher.FilterDispatcher </ filter-class >
    24 ???? </ filter >
    25 ???? < filter-mapping >
    26 ???????? < filter-name > webwork-cleanup </ filter-name >
    27 ???????? < url-pattern > *.ftl </ url-pattern >
    28 ???? </ filter-mapping >
    29 ???? < filter-mapping >
    30 ???????? < filter-name > sitemesh </ filter-name >
    31 ???????? < url-pattern > *.ftl </ url-pattern >
    32 ???? </ filter-mapping >
    33 ???? < filter-mapping >
    34 ???????? < filter-name > encodingFilter </ filter-name >
    35 ???????? < url-pattern > *.ftl </ url-pattern >
    36 ???? </ filter-mapping >
    37 ???? < filter-mapping >
    38 ???????? < filter-name > webwork </ filter-name >
    39 ???????? < url-pattern > *.ftl </ url-pattern >
    40 ???? </ filter-mapping >
    41 ???? < filter-mapping >
    42 ???????? < filter-name > webwork </ filter-name >
    43 ???????? < url-pattern > /webwork/* </ url-pattern >
    44 ???? </ filter-mapping >

    xwork.xml配置如下:
    1????????<action
    2????????????name="index"
    3????????????class="com.opensymphony.xwork.ActionSupport">
    4????????????<result
    5????????????????name="success"
    6????????????????type="freemarker">
    7????????????????<param?name="location">/admin/index.ftl</param>
    8????????????</result>
    9????????</action>
    sitemesh 配置如下
    1????<decorator
    2????????name="admin"
    3????????page="/admin/main.ftl">
    4????????<pattern>/admin/*.ftl</pattern>
    5????</decorator>

    在tomcat 5.1.17、resin 3.0.19上跑得順順利利的,一移到weblogic 8.1.5上就報(bào)錯(cuò)
    ?1####<2006-9-8?上午02時(shí)46分44秒?CST>?<Error>?<HTTP>?<www-c1f900a12b2>?<myserver>?<ExecuteThread:?'14'?for?queue:?'weblogic.kernel.Default'>?<<WLS?Kernel>>?<>?<BEA-101104>?<Servlet?execution?in?servlet?context?"ServletContext(id=2664121,name=rules,context-path=/rules)"?failed,?java.net.ProtocolException:?Didn't?meet?stated?Content-Length,?wrote:?'4949'?bytes?instead?of?stated:?'4763'?bytes..
    ?2java.net.ProtocolException:?Didn't?meet?stated?Content-Length,?wrote:?'4949'?bytes?instead?of?stated:?'4763'?bytes.
    ?3????at?weblogic.servlet.internal.ServletOutputStreamImpl.ensureContentLength()V(ServletOutputStreamImpl.java:481)
    ?4????at?weblogic.servlet.internal.ServletResponseImpl.ensureContentLength()V(ServletResponseImpl.java:1253)
    ?5????at?weblogic.servlet.internal.ServletResponseImpl.send()V(ServletResponseImpl.java:1265)
    ?6????at?weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread;)V(ServletRequestImpl.java:2771)
    ?7????at?weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest;)V(ExecuteThread.java:224)
    ?8????at?weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:183)
    ?9????at?java.lang.Thread.startThreadFromVM(Ljava/lang/Thread;)V(Unknown?Source)
    10>?

    折騰了好幾天,各種方式試過(guò),最后還是從sitemesh cvs上下了最新的源碼重新編譯解決問(wèn)題。
    posted @ 2006-09-13 17:52 mmwy 閱讀(1955) | 評(píng)論 (1)編輯 收藏

    主站蜘蛛池模板: 暖暖免费中文在线日本| 6080午夜一级毛片免费看6080夜福利| 免费观看激色视频网站bd| 亚洲国产精品一区二区第一页免 | 亚洲乱亚洲乱妇无码麻豆| 亚洲人成网站在线在线观看| 久久免费公开视频| 久久亚洲av无码精品浪潮| 亚洲精品成a人在线观看夫| 亚洲视频免费播放| 国产亚洲精久久久久久无码| 免费国产高清毛不卡片基地| 成人免费无码视频在线网站| 亚洲天天在线日亚洲洲精| 丝袜足液精子免费视频| 免费一级毛片在级播放| 亚洲色无码国产精品网站可下载| 91老湿机福利免费体验| 亚洲人成人网站色www| 污污污视频在线免费观看| 韩国18福利视频免费观看| 亚洲国产模特在线播放| 十八禁无码免费网站| 久久影视国产亚洲| 高h视频在线免费观看| 男女啪啪永久免费观看网站| 亚洲一区二区三区久久| 在线观看的免费网站无遮挡| 亚洲AV无码乱码国产麻豆 | 免费视频成人片在线观看| 亚洲精品中文字幕乱码三区| 人妻18毛片a级毛片免费看| 国产无遮挡色视频免费视频| 亚洲熟妇无码av另类vr影视 | 亚洲小说区图片区另类春色| 无码毛片一区二区三区视频免费播放 | 四虎影视在线永久免费看黄| 亚洲中文精品久久久久久不卡| 免费阿v网站在线观看g| 亚洲AV综合色区无码二区偷拍| 精品久久8x国产免费观看|