指示mime类型是否表示包含html或xhtml的文档。
/** n o w j a v a . c o m **/ //package com.nowjava; public class Main { /** * Indicates whether a mime-type represents an document containing html * or xhtml. * @param mimeType * @return true if mime-type represents a html document. */ public static boolean isHTML(String mimeType) { if (mimeType.equals("text/html") || mimeType.equals("application/xhtml+xml")) { return true; } return false; } }