类 UHtml

java.lang.Object
com.gdxsoft.easyweb.utils.UHtml

public class UHtml extends Object
  • 字段详细资料

  • 构造器详细资料

    • UHtml

      public UHtml()
  • 方法详细资料

    • combineFiles

      public static int combineFiles(String path, String ext, String savePathAndName) throws Exception
      将单元文件进行合并,例如js文件或css文件等
      参数:
      path - 路径
      ext - 扩展名
      savePathAndName - 保存路径
      返回:
      0表示目录不存在
      抛出:
      Exception
    • getHttpBody

      public static String getHttpBody(javax.servlet.http.HttpServletRequest request) throws IOException
      Get http body content
      参数:
      request - HttpServletRequest (javax)
      返回:
      the http body string(UTF8)
      抛出:
      IOException
    • getHttpBody

      public static String getHttpBody(javax.servlet.http.HttpServletRequest request, String charset) throws IOException
      Get http body content
      参数:
      request - HttpServletRequest (javax)
      charset - The charset name
      返回:
      the http body string
      抛出:
      IOException
    • getHttpBodyBytes

      public static byte[] getHttpBodyBytes(javax.servlet.http.HttpServletRequest request) throws IOException
      Get the request body content
      参数:
      request -
      返回:
      抛出:
      IOException
    • getHttpBase

      public static String getHttpBase(javax.servlet.http.HttpServletRequest request)
      Get the base url from the HttpServletRequest
      参数:
      request - the HttpServletRequest
      返回:
      the base url
    • getHttpBase

      public static String getHttpBase(javax.servlet.http.HttpServletRequest request, String baseAdd)
      Get the base url from the HttpServletRequest
      参数:
      request - the HttpServletRequest
      baseAdd - the path of attachment
      返回:
      the base url
    • htmlETag

      public static String htmlETag()
    • removeHtmlEvents

      public static String removeHtmlEvents(String html)
      去除html的 on事件 例如 onclick,onmousedown ..., 用于Html编辑器粘贴后去除
      参数:
      html -
      返回:
      去除html的 on事件 例如 onclick,onmousedown ..., 用于Html编辑器粘贴后去除
    • removeHtmlAttributes

      public static String removeHtmlAttributes(String html)
      去除html标签属性(保留图片的src路径)
      参数:
      html -
      返回:
      去除html标签属性(保留图片的src路径)
    • removeHtmlTag

      public static String removeHtmlTag(String html, String tagName)
      Remote the html tag
      参数:
      html - the html string
      tagName - the tag to delete (iframe, script ...)
      返回:
      the result
    • createListSplit

      public static String createListSplit(IPageSplit pageSplit, String pageUrlRoot, String target, boolean isShowAsTable)
      创建类似BBS类型的分页
      参数:
      pageSplit - ListFrame分页参数
      pageUrlRoot - 根路径
      target - 连接窗口(_self,_blank ...)
      isShowAsTable - 是否以表格方式显示(兼容IE6)
      返回:
      字符串
    • createListSplit

      public static String createListSplit(int iCurPage, int iPageSize, int iTotalRecords, String pageUrlRoot)
      Create a pagination div
      参数:
      iCurPage - the current page
      iPageSize - the page size
      iTotalRecords - the total records
      pageUrlRoot - the page url (../bbs/xxx/yy/{EXP}.html) the {EXP} is the page number replacement
      返回:
      the pagination html
    • createListSplitTable

      public static String createListSplitTable(int iCurPage, int iPageSize, int iTotalRecords, String pageUrlRoot)
      Create a pagination table
      参数:
      iCurPage - the current page
      iPageSize - the page size
      iTotalRecords - the total records
      pageUrlRoot - the page url (../bbs/xxx/yy/{EXP}.html) the {EXP} is the page number replacement
      返回:
      the pagination html(table)