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

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

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

    無聊人士

    搬家==》www.soapui.cn

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

    2007年4月20日 #

    struts 2.0.6GA開始試螃蟹,照著struts2的tag文檔寫成<@s.datetimepicker/>,結(jié)果老是報錯
    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一下,正好有人也提交了這個bug,改成 <@s.dateTimePicker />,問題解決

    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 閱讀(2596) | 評論 (0)編輯 收藏

    2007年4月8日 #

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

    3.Re:BIRT報表工具的問題?[Re:?uxa]?????Copy?to?clipboard
    Posted?by:?uxa
    Posted?on:?
    2006-09-15?15:28

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

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

    2.?BIRT預(yù)設(shè)有支援HTML和PDF的格式,以下說明如何支援xls格式
    a.?download?xls-emitter-bin_2
    .1.0.zip,解開後將plugins複製到eclipse\plugins下
    b.?download?poi-bin-
    3.0-alpha2-20060616.zip,解開後將jar檔複製到eclipse\plugins\?org.uguess.birt.report.engine.emitter.xls_2.1.0.200607031206\lib
    c.?xls-emitter-bin_2
    .1.0.zip解開後有個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

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

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

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

    2007年4月7日 #

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

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

    我的測試?yán)雍芎唵危^承ImageEventAdapter類,重載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???????//實際應(yīng)用中,可以使用image.getRowData().getColumnValue("columnname")獲得字段值
    19???????String?code?=?"ABCDEF123-2222";
    20???????//似乎windows文件名中不允許使用“-”等符號,干脆將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?

    測試用的birt報表文件簡單得要死,就往上面扔了個image元素,設(shè)置其Event Handler Class為剛才寫好的java類,最終得到的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>

    運行測試,條形碼出來了
    birt.jpg

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


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

    2007年4月6日 #

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

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

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

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

    2007年3月19日 #

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

    有幾點注意的:
    1、除了照文檔的例子在注冊表"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
    這個extension_uri寫成什么路徑,就得在iis站點中建相應(yīng)名字的虛擬目錄(執(zhí)行權(quán)限),以保證/jakarta/isapi_redirect.dll能被正常訪問到。

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

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




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

    2006年11月24日 #



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

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

    或是直接打開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 閱讀(1880) | 評論 (0)編輯 收藏

    2006年11月23日 #

    定義報表參數(shù):

    3.jpg



    解決方法一:

    1.jpg


    2.jpg



    解決辦法二:

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

    4.jpg


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

    2006年10月31日 #

    筆記一下:

    設(shè)hibernate.hbm2ddl.auto為update/create-drop/create后,在classpath中扔一個/import.sql進(jìn)去,hibernate啟動時就會執(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 閱讀(5763) | 評論 (2)編輯 收藏

    2006年10月15日 #

    使用的安裝包:
    ?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ù)的支持,同時修復(fù)了相關(guān)補丁,因此,文檔中為php打補丁、重建“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)建一個名為libclntsh.so的連接,否則在configure過程中將會出現(xiàn)error:Link xxxx not found的錯誤。(http://forums.oracle.com/forums/thread.jspa?messageID=1203218&#1203218

    測試
    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. 測試代碼
      ?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) | 評論 (1)編輯 收藏

    2006年10月12日 #

    最近在“玩”hibernate Annotation,弄了個Attachment保存進(jìn)數(shù)據(jù)庫的測試,附件內(nèi)容保存在content屬性里面。
    ??@Lob
    ??@Column(columnDefinition?
    =?"LongBlob")
    ??
    public?byte[]?getContent()?{
    ????
    return?content;
    ??}
    一開始,配置mysql jdbc url如下
    jdbc.url????????????=????jdbc:mysql://localhost/test\
    ?????????????????????????????useUnicode
    =true\
    ????????????????????????????&characterEncoding
    =gbk
    一測試,報錯
    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)
    同樣的語句,直接在mysql命令行下運行就沒問題,偏偏jdbc上就有這臭毛病。換jdbc driver版本,改@Lob為 @Type(type = "org.springframework.orm.hibernate3.support.BlobByteArrayType"),改hibernate配置(比如hibernate.jdbc.use_streams_for_binary true),甚至是直接用jdbc來insert,亂七八糟折騰半天,問題照舊。最后只好用上“歪”招,把byte[]配成String,在保存的時候把byte[]保存成hex String格式,取的時候再解碼回來。

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

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

    僅列出標(biāo)題  下一頁
    主站蜘蛛池模板: 中国亚洲女人69内射少妇| 成视频年人黄网站免费视频| 国产精品无码一区二区三区免费 | 一级毛片aaaaaa视频免费看| 国产成人A在线观看视频免费| 亚洲精品一卡2卡3卡三卡四卡| 未满十八18禁止免费无码网站| 无码专区—VA亚洲V天堂| 久久国产色AV免费观看| 亚洲成无码人在线观看| 99在线精品视频观看免费| 亚洲国产乱码最新视频| 女人18毛片水真多免费看| 成人免费观看男女羞羞视频| 免费jlzzjlzz在线播放视频| 无码AV动漫精品一区二区免费| 国产成人亚洲影院在线观看| 久久久久久av无码免费看大片| 久久精品国产精品亚洲精品| 久久永久免费人妻精品下载| 亚洲国产成人久久77| 天天干在线免费视频| 人妻巨大乳hd免费看| 国产精品久久久亚洲| 999国内精品永久免费观看| 中文字幕无码亚洲欧洲日韩| 免费国产怡红院在线观看| 一级做受视频免费是看美女| 久久精品视频亚洲| 亚洲日日做天天做日日谢| 男女交性永久免费视频播放| 国产日韩久久免费影院| 亚洲短视频在线观看| 日本一道综合久久aⅴ免费| 精品人妻系列无码人妻免费视频| 亚洲AV永久无码精品一百度影院 | 毛片a级毛片免费观看品善网| 最新亚洲人成网站在线观看| 国产aⅴ无码专区亚洲av麻豆 | AV激情亚洲男人的天堂国语| 亚洲中文字幕无码永久在线|