⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 davutil.java

📁 wiki建站资源 java编写的 很好用
💻 JAVA
字号:
/* * (C) Janne Jalkanen 2005 *  */package com.ecyrd.jspwiki.dav;import java.io.IOException;import java.util.Collection;import java.util.Iterator;import javax.servlet.http.HttpServletResponse;import org.apache.ecs.XhtmlDocument;import org.apache.ecs.xhtml.li;import org.apache.ecs.xhtml.ul;import com.ecyrd.jspwiki.WikiContext;import com.ecyrd.jspwiki.WikiPage;/** *  @author jalkanen * *  @since  */public class DavUtil{    public static String getCollectionInHTML( WikiContext context, Collection coll )    {        XhtmlDocument doc = new XhtmlDocument("UTF-8");                ul content = new ul();                for( Iterator i = coll.iterator(); i.hasNext(); )        {            Object o = i.next();                        if( o instanceof WikiPage )            {                WikiPage p = (WikiPage)o;                content.addElement( new li().addElement( p.getName() ) );            }            else if( o instanceof String )            {                content.addElement( new li().addElement( o.toString() ));            }        }        doc.appendBody( content );                return doc.toString();    }        public static void sendHTMLResponse( HttpServletResponse res, String txt )    throws IOException    {        res.setContentType( "text/html; charset=UTF-8" );        res.setContentLength( txt.length() );                res.getWriter().print( txt );    }    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -