Java HTML Filter filterHtmlTag(String body)

Here you can find the source of filterHtmlTag(String body)

Description

filter Html Tag

License

Open Source License

Declaration

public static String filterHtmlTag(String body) 

Method Source Code

//package com.java2s;

public class Main {
    public static String filterHtmlTag(String body) {
        if (body == null) {
            return "";
        }//from w w w  . ja  v a  2 s  . c om
        body = body.replaceAll("FRAME", "");
        body = body.replaceAll("frame", "");
        body = body.replaceAll("Frame", "");
        body = body.replaceAll("APPLET", "");
        body = body.replaceAll("applet", "");
        body = body.replaceAll("Applet", "");
        body = body.replaceAll("<SCRIPT", "&lt;SCRIPT");
        body = body.replaceAll("<Script", "&lt;SCRIPT");
        body = body.replaceAll("<script", "&lt;SCRIPT");
        body = body.replaceAll("<BODY>", "&lt;body&gt;");
        body = body.replaceAll("<Body>", "&lt;body&gt;");
        body = body.replaceAll("<body>", "&lt;body&gt;");
        body = body.replaceAll("<form>", "&lt;form&gt;");
        body = body.replaceAll("<FORM>", "&lt;form&gt;");
        body = body.replaceAll("<Form>", "&lt;form&gt;");
        return body;
    }
}

Related

  1. filterHTML(String input)
  2. filterHTML(String s)
  3. filterHtml(String s)
  4. filterHtmlAndTruncate(String s)
  5. filterHtmlAndTruncate(String s)
  6. filterHtmlTag(String content)
  7. filterHtmlTag(String input)