欧美三区_成人在线免费观看视频_欧美极品少妇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)論
主站蜘蛛池模板: 免费欧美黄色 | 国产午夜精品理论片 | 中文成人在线 | 日本大片久久久高清免费看 | 国产精品日韩专区 | 午夜成人在线视频 | 久久国产这里只精品免费 | 日韩精品视频在线观看免费 | 国产欧美一区二区三区免费看 | 天天色综合色 | 大色综合| a级欧美片免费观看 | 中国免费一级毛片 | 亚州老熟女A片AV色欲小说 | 欧美日批 | 91最新视频 | 97在线观视频免费观看 | 中文字幕一区二区三区四区五区 | 韩国男女无遮挡高清性视频 | 黄色免费网站在线观看 | 国产精品男人的天堂 | 久久av一区二区三区 | 在线成人免费视频 | 亚洲国产成人精品女人 | 国产亚洲精品2021自在线 | A片扒开双腿进入做视频 | 国产在线一区二区三区 | 中文字幕av一区二区 | 521国产精品视频 | 国内久久 | 亚洲精品色 | 91久久久久久 | 色老头永久免费视频 | 激情综合五月 | 欧美一级片在线播放 | 美日韩一区二区三区 | 亚洲综合无码一区二区 | 亚洲精品一区二区三区婷婷月色 | 欧美—级v免费大片 | 日韩一区欧美 | 91精品国产91久久久久久 |