• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

Use Java to implement the UBB future.

发布: 2007-7-01 18:47 | 作者: admin | 来源: | 查看: 15次 | 进入软件测试论坛讨论

领测软件测试网 UBB & JAVA
    ----Use Java to implement the UBB future.

[Author] pizer.chen -- iceant -- 陈鹏
[email ] [email protected]
[icq   ] 77777369

These days,I write some publish system,just like BBS/news etc.
The client asked me ,whether they can insert the image and href url to the plain text when they published them.
so i write this.
I use xml file for dynamic UBB extends.
U can make the UBB rule of yourself.
The only thing that u need to do is modify the UBB.xml config file.

Best Regards
===============
                                                                    pizer.chen/2001-9-4

===========================
    Resource Link
===========================
It is based on xml & RegularExpressions tech.
about xml & regularExpression u can find them here:

http://www.w3.org/XML/     
http://xml.apache.org
http://www.meurrens.org/ip-Links/java/regex/navi.html
http://www.savarese.org/oro/
http://jakarta.apache.org/oro
about ubb u can find them here:
http://www.ubbdesign.com

========================
it used :
    jakarta-regexp-1.2              (download form http://jakarta.apache.org)
    dom4j-0.6(over 0.6 version)     (download form http://sourceforge.net)
    jdk(over 1.2 version)           (download form http://java.sun.com)

==========================
        UBB.XML
it must be stored in CLASSPATH
==========================
the regularExpression & replace string map file.
<!--============================-->

<?xml version="1.0" encoding="UTF-8"?>
<UBB-map>
    <map ubb-code="\[b\](.+?)\[\/b\]" map-to="<b>$1</b>"/>         <!--<b>$1</b>-->
    <map ubb-code="\[i\](.+?)\[\/i\]" map-to="<i>$1</i>"/>         <!--<i>$1</i>-->
    <map ubb-code="\[h1\](.+?)\[\/h1\]" map-to="<h1>$1</h1>"/>     <!--<h1>$1</h1>-->
    <map ubb-code="\hehe..";

            System.out.println(UBB.parse(test));
        }catch(Exception err){
            System.out.println(err);
        }
    }
}

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网