欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

rsslibj

系統(tǒng) 1689 0
RSS是一個(gè)標(biāo)準(zhǔn)的XML文件,Rss閱讀器可以讀取這個(gè)XML文件獲得文章的信息,使用戶可以通過Rss閱讀器
而非瀏覽器閱讀Blog,我們只要?jiǎng)討B(tài)生成這個(gè)XML文件便可以了。RSSLibJ是一個(gè)專門讀取和生成RSS的小
巧實(shí)用的Java庫,大小僅25k,可以從 http://sourceforge.net/projects/rsslibj/ 下載rsslibj-

1_0RC2.jar和它需要的EXMLjar兩個(gè)文件,然后復(fù)制到web/WEB-INF/lib/下。
?
?

下載下來之后把 擴(kuò)張名.zip 改為 .jar 就行了。

Java代碼 復(fù)制代碼
  1. import ?com.rsslibj.elements.Channel; ??
  2. public ? class ?Writer?{ ??
  3. ???? public ? static ? void ?main(String[]?args)? ??
  4. ???????????? throws ?InstantiationException,?ClassNotFoundException,? ??
  5. ????????????IllegalAccessException?{ ??
  6. ????????Channel?channel= new ?Channel(); ??
  7. ????????channel.setDescription( "This?is?my?sample?channel." ); ??
  8. ????????channel.setLink( "http://localhost/" ); ??
  9. ????????channel.setTitle( "My?Channel" ); ??
  10. ????????channel.setImage( "http://localhost/" ,? ??
  11. ???????????????? "The?Channel?Image" ,? ??
  12. ???????????????? "http://localhost/foo.jpg" ); ??
  13. ????????channel.setTextInput( "http://localhost/search" ,? ??
  14. ???????????????? "Search?The?Channel?Image" ,? ??
  15. ???????????????? "The?Channel?Image" ,? ??
  16. ???????????????? "s" ); ??
  17. ????????channel.addItem( "http://localhost/item1" , ??
  18. ???????????????? "The?First?Item?covers?details?on?the?first?item>" , ??
  19. ???????????????? "The?First?Item" ) ??
  20. ????????????????.setDcContributor( "Joseph?B.?Ottinger" ); ??
  21. ????????channel.addItem( "http://localhost/item2" , ??
  22. ???????????????? "The?Second?Item?covers?details?on?the?second?item" , ??
  23. ???????????????? "The?Second?Item" ) ??
  24. ????????????????.setDcCreator( "Jason?Bell" ); ??
  25. ????????System.out.println( "The?feed?in?RDF:?" +channel.getFeed( "rss" )); ??
  26. ????} ??
  27. }??
Java代碼 復(fù)制代碼
  1. import ?com.rsslibj.elements.Channel; ??
  2. public ? class ?Writer?{ ??
  3. ???? public ? static ? void ?main(String[]?args)? ??
  4. ???????????? throws ?InstantiationException,?ClassNotFoundException,? ??
  5. ????????????IllegalAccessException?{ ??
  6. ????????Channel?channel= new ?Channel(); ??
  7. ????????channel.setDescription( "This?is?my?sample?channel." ); ??
  8. ????????channel.setLink( "http://localhost/" ); ??
  9. ????????channel.setTitle( "My?Channel" ); ??
  10. ????????channel.setImage( "http://localhost/" ,? ??
  11. ???????????????? "The?Channel?Image" ,? ??
  12. ???????????????? "http://localhost/foo.jpg" ); ??
  13. ????????channel.setTextInput( "http://localhost/search" ,? ??
  14. ???????????????? "Search?The?Channel?Image" ,? ??
  15. ???????????????? "The?Channel?Image" ,? ??
  16. ???????????????? "s" ); ??
  17. ????????channel.addItem( "http://localhost/item1" , ??
  18. ???????????????? "The?First?Item?covers?details?on?the?first?item>" , ??
  19. ???????????????? "The?First?Item" ) ??
  20. ????????????????.setDcContributor( "Joseph?B.?Ottinger" ); ??
  21. ????????channel.addItem( "http://localhost/item2" , ??
  22. ???????????????? "The?Second?Item?covers?details?on?the?second?item" , ??
  23. ???????????????? "The?Second?Item" ) ??
  24. ????????????????.setDcCreator( "Jason?Bell" ); ??
  25. ????????System.out.println( "The?feed?in?RDF:?" +channel.getFeed( "rss" )); ??
  26. ????} ??
  27. }??
      import com.rsslibj.elements.Channel;
public class Writer {
    public static void main(String[] args) 
            throws InstantiationException, ClassNotFoundException, 
            IllegalAccessException {
        Channel channel=new Channel();
        channel.setDescription("This is my sample channel.");
        channel.setLink("http://localhost/");
        channel.setTitle("My Channel");
        channel.setImage("http://localhost/", 
                "The Channel Image", 
                "http://localhost/foo.jpg");
        channel.setTextInput("http://localhost/search", 
                "Search The Channel Image", 
                "The Channel Image", 
                "s");
        channel.addItem("http://localhost/item1",
                "The First Item covers details on the first item>",
                "The First Item")
                .setDcContributor("Joseph B. Ottinger");
        channel.addItem("http://localhost/item2",
                "The Second Item covers details on the second item",
                "The Second Item")
                .setDcCreator("Jason Bell");
        System.out.println("The feed in RDF: "+channel.getFeed("rss"));
    }
}

    
?
Java代碼 復(fù)制代碼
  1. Channel?channel?=? new ?Channel();? ??
  2. channel.setDescription(account.getDescription());? ??
  3. baseUrl?=?baseUrl.substring( 0 ,?n);? ??
  4. channel.setLink( "http://server-name/home.c?accountId=" ?+?accountId);? ??
  5. channel.setTitle(account.getTitle());? ??
  6. List?articles?=?facade.getArticles(accountId,?account.getMaxPerPage(),? 1 );? ??
  7. Iterator?it?=?articles.iterator();? ??
  8. while (it.hasNext())?{? ??
  9. ????Article?article?=?(Article)it.next();? ??
  10. ????channel.addItem( "http://server-name/article.c?articleId=" ?+?article.getArticleId(),? ??
  11. ????????article.getSummary(),?article.getTitle()? ??
  12. ????);? ??
  13. }? ??
  14. //?輸出xml:? ??
  15. response.setContentType( "text/xml" );? ??
  16. PrintWriter?pw?=?response.getWriter();? ??
  17. pw.print(channel.getFeed( "rss" ));? ??
  18. pw.close();???
Java代碼 復(fù)制代碼
  1. Channel?channel?=? new ?Channel();? ??
  2. channel.setDescription(account.getDescription());? ??
  3. baseUrl?=?baseUrl.substring( 0 ,?n);? ??
  4. channel.setLink( "http://server-name/home.c?accountId=" ?+?accountId);? ??
  5. channel.setTitle(account.getTitle());? ??
  6. List?articles?=?facade.getArticles(accountId,?account.getMaxPerPage(),? 1 );? ??
  7. Iterator?it?=?articles.iterator();? ??
  8. while (it.hasNext())?{? ??
  9. ????Article?article?=?(Article)it.next();? ??
  10. ????channel.addItem( "http://server-name/article.c?articleId=" ?+?article.getArticleId(),? ??
  11. ????????article.getSummary(),?article.getTitle()? ??
  12. ????);? ??
  13. }? ??
  14. //?輸出xml:? ??
  15. response.setContentType( "text/xml" );? ??
  16. PrintWriter?pw?=?response.getWriter();? ??
  17. pw.print(channel.getFeed( "rss" ));? ??
  18. pw.close();???
      Channel channel = new Channel(); 
channel.setDescription(account.getDescription()); 
baseUrl = baseUrl.substring(0, n); 
channel.setLink("http://server-name/home.c?accountId=" + accountId); 
channel.setTitle(account.getTitle()); 
List articles = facade.getArticles(accountId, account.getMaxPerPage(), 1); 
Iterator it = articles.iterator(); 
while(it.hasNext()) { 
    Article article = (Article)it.next(); 
    channel.addItem("http://server-name/article.c?articleId=" + article.getArticleId(), 
        article.getSummary(), article.getTitle() 
    ); 
} 
// 輸出xml: 
response.setContentType("text/xml"); 
PrintWriter pw = response.getWriter(); 
pw.print(channel.getFeed("rss")); 
pw.close(); 

    
?
Java代碼 復(fù)制代碼
  1. import ?com.rsslibj.elements.Channel; ??
  2. ??
  3. public ?classWriter{ ??
  4. ???? public ? static ? void ?main(String[]?args)? ??
  5. ???????? throws ?InstantiationException,ClassNotFoundException,IllegalAccessException?{ ??
  6. ???????? ??
  7. ????????Channel?channel?=? new ?Channel(); ??
  8. ????????channel.setDescription( "Thisismysamplechannel." ); ??
  9. ????????channel.setLink( "/" ); ??
  10. ????????channel.setTitle( "MyChannel" ); ??
  11. ????????channel.setImage( "/" ,? "TheChannelImage" ,? "/foo.jpg" ); ??
  12. ????????channel.setTextInput( "/search" ,? "SearchTheChannelImage" ,? "TheChannelImage" ,? "s" ); ??
  13. ????????channel.addItem( "/item1" ,? "TheFirstItemcoversdetailsonthefirstitem>" ,? ??
  14. ???????????????? "TheFirstItem" ).setDcContributor( "JosephB.Ottinger" ); ??
  15. ????????channel.addItem( "/item2" ,? "TheSecondItemcoversdetailsontheseconditem" , ??
  16. ???????????????? "TheSecondItem" ).setDcCreator( "JasonBell" ); ??
  17. ????????System.out.println( "ThefeedinRDF:" ?channel.getFeed( "rdf" )); ??
  18. ????} ??
  19. }??

rsslibj


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 成人激情四射 | 欧美一级黄色免费看 | 日韩成人在线观看视频 | 天天综合亚洲 | 亚洲人网站 | 精品国产不卡一区二区三区 | 国产精品一区久久久 | www日日日| 亚洲国产综合久久精品 | 日本黄色不卡视频 | 91福利免费体验区观看区 | 天天天插| 一级观看免费完整版视频 | 久久999视频 | 最近免费日本视频在线 | 国产日韩一区二区三区 | 欧洲成人午夜免费大片 | 色九九 | www国产成人免费观看视频,深夜成人网 | 午夜爱爱爱爱爽爽爽网站免费 | 额去鲁97在线观看视频 | 91在线观看网站 | 天天鲁天天爽天天视频 | 欧美在线a | 国产成人在线视频播放 | 中文字幕在线免费看 | 精品无人乱码高清 | 久久一区二区三区四区 | 国产午夜精品福利视频 | 色tv国产 | 亚洲在成人网在线看 | 久久亚洲一区二区 | 12av毛片| 日本精品欧洲www | 国产成人精品视频免费 | 成人精品在线 | 九热精品 | 欧美日韩精品一区二区 | 精品一区二区日本高清 | 午夜第一页 | 激情se|