- 浏览: 2555184 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
主要使用了一个UTIL工具来过滤HTML
其中使用到了alibaba的几个类,
import com.alibaba.common.lang.ObjectUtil;
import com.alibaba.common.lang.StringEscapeUtil;
import com.alibaba.common.lang.i18n.LocaleUtil;
import com.alibaba.common.lang.internal.Entities;
import com.alibaba.common.lang.StringUtil;
package com.megaeyes.ipcamera.service.util;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.apache.commons.codec.binary.Base64;
import org.apache.html.dom.HTMLDocumentImpl;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.PatternMatcher;
import org.apache.oro.text.regex.PatternMatcherInput;
import org.apache.oro.text.regex.Perl5Compiler;
import org.apache.oro.text.regex.Perl5Matcher;
import org.apache.oro.text.regex.Perl5Substitution;
import org.apache.oro.text.regex.Util;
import org.apache.xerces.xni.parser.XMLDocumentFilter;
import org.cyberneko.html.filters.ElementRemover;
import org.cyberneko.html.parsers.DOMFragmentParser;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.html.HTMLDocument;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import com.alibaba.common.lang.ObjectUtil;
import com.alibaba.common.lang.StringEscapeUtil;
import com.alibaba.common.lang.i18n.LocaleUtil;
import com.alibaba.common.lang.internal.Entities;
import com.alibaba.common.lang.StringUtil;
public class TBStringUtil {
private static MessageDigest mHasher;
private static char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
private static Pattern escapeURLsInHTMLPattern = null;
private static Pattern escapeSpecialHTMLPattern = null;
private static String[] commonAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title" };
private static String[] divAttribute = new String[] { "align", "valign",
"class", "bgcolor", "background", "title" };
private static String[] imgAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title", "src",
"border", "width", "height", "alt", "usemap" };
private static String[] fontAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title", "color",
"size", "face" };
private static String[] tableAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title", "border",
"width", "height", "cellpadding", "cellspacing", "bordercolor",
"blockquote" };
private static String[] tdAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title", "width",
"height", "colspan", "rowspan" };
private static String[] marqueeAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title",
"scrollamount", "direction", "behavior", "width", "height",
"scrolldelay" };
private static String[] aAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title", "target",
"name", "href" };
private static String[] bgsoundAttribute = new String[] { "src", "loop" };
private static String[] mapAttribute = new String[] { "name" };
private static String[] areaAttribute = new String[] { "href", "shape",
"coords" };
private static Set INLINE_CLOSED_TAG = new HashSet();
static {
INLINE_CLOSED_TAG.add("img");
INLINE_CLOSED_TAG.add("br");
INLINE_CLOSED_TAG.add("input");
try {
escapeURLsInHTMLPattern = (new Perl5Compiler())
.compile("(http://[a-zA-Z0-9_/&=?\\.;]*)");
escapeSpecialHTMLPattern = (new Perl5Compiler()).compile(
"^http://[a-z0-9]+\\.taobao\\.com.*$",
Perl5Compiler.CASE_INSENSITIVE_MASK);
} catch (Exception e) {
e.printStackTrace();
}
try {
mHasher = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException nex) {
mHasher = null;
nex.printStackTrace();
}
}
public static String hash(String str) {
byte[] bt = null;
synchronized (mHasher) {
bt = mHasher.digest(str.getBytes());
}
int l = bt.length;
char[] out = new char[l << 1];
for (int i = 0, j = 0; i < l; i++) {
out[j++] = digits[(0xF0 & bt[i]) >>> 4];
out[j++] = digits[0x0F & bt[i]];
}
return new String(out);
}
/**
* 转化字符串以适合html输出
*
* @param str
*
* @return
*/
public static String escapeHTML(String strInput) {
if (strInput == null) {
return "";
}
try {
StringWriter out = new StringWriter(strInput.length());
if (escapeEntities(Entities.HTML40, strInput, out)) {
return out.toString();
}
return strInput;
} catch (IOException e) {
return ""; // StringWriter不可能发生这个异常
}
}
/**
* 将字符串中的部分字符转换成实体编码。
*
* @param entities
* 实体集合
* @param str
* 要转义的字符串
* @param out
* 字符输出流,不能为<code>null</code>
*
* @return 如果字符串没有变化,则返回<code>false</code>
*
* @throws IllegalArgumentException
* 如果<code>entities</code>或输出流为<code>null</code>
* @throws IOException
* 如果输出失败
*/
protected static boolean escapeEntities(Entities entities, String str,
Writer out) throws IOException {
boolean needToChange = false;
if (entities == null) {
throw new IllegalArgumentException("The Entities must not be null");
}
if (out == null) {
throw new IllegalArgumentException("The Writer must not be null");
}
if (str == null) {
return needToChange;
}
for (int i = 0; i < str.length(); ++i) {
char ch = str.charAt(i);
String entityName = entities.getEntityName(ch);
if (entityName == null) {
if (ch == '\n') {
out.write('<');
out.write('b');
out.write('r');
out.write('/');
out.write('>');
// out.write(ch);
} else if (ch == '\r') {
// nodo
} else {
out.write(ch);
}
needToChange = true;
} else {
out.write('&');
out.write(entityName);
out.write(';');
// 设置改变标志
needToChange = true;
}
}
return needToChange;
}
/**
* 比较两个字符串是否相等,""与null相等 extends com.alibaba.common.lang.StringUtil
*
* @param str1
* @param str2
*
* @return
*/
public static boolean equals(String str1, String str2) {
if (StringUtil.isBlank(str1) && StringUtil.isBlank(str2)) {
return true;
}
return StringUtil.equals(str1, str2);
}
/**
* 去除特殊的HTML标记,自动补齐不完整的HTML
*
* @param String
* 转换前的HTML
*
* @return String 转换后的HTML
*/
public static String escapeSpecialHTML(String str) {
return escapeSpecialHTML(str, true);
}
/**
* 去除HTML标记
*
* @param str
* @return
*/
public static String stripHTML(String str) {
if (StringUtil.isBlank(str)) {
return "";
}
try {
DOMFragmentParser parser = new DOMFragmentParser();
// 标签过滤器
// acceptElement指接受那些html标签。removeElement表示那些标签会全部除去(包括子标签)。这两种之外的会去掉标签,但保留内容。
ElementRemover remover = new ElementRemover();
remover.removeElement("script");
remover.removeElement("style");
remover.removeElement("head");
remover.removeElement("select");
XMLDocumentFilter[] filters = { remover };
parser.setProperty("http://cyberneko.org/html/properties/filters",
filters);
HTMLDocument document = new HTMLDocumentImpl();
DocumentFragment fragment = document.createDocumentFragment();
InputSource is = new InputSource(new StringReader(str));
is.setEncoding("GBK");
parser.parse(is, fragment);
return getHTML(fragment, false).toString();
} catch (IOException e) {
// e.printStackTrace();
} catch (SAXException e) {
// e.printStackTrace();
} catch (Exception e) {
// ingore
}
return escapeHTML(str);
}
/**
* 去除特殊的HTML标记,自动补齐不完整的HTML
*
* @param String
* 转换前的HTML
* @param boolean
* forOutPut
* true:判断表格和链接是否合法。false:不判断。系统中发布宝贝的时候存入数据库前是true,显示宝贝的时候用的false
*
* @return String 转换后的HTML
*/
public static String escapeSpecialHTML(String str, boolean check) {
if (StringUtil.isBlank(str)) {
return "";
}
try {
DOMFragmentParser parser = new DOMFragmentParser();
// 标签过滤器
// acceptElement指接受那些html标签。removeElement表示那些标签会全部除去(包括子标签)。这两种之外的会去掉标签,但保留内容。
ElementRemover remover = new ElementRemover();
remover.acceptElement("b", commonAttribute);
remover.acceptElement("i", commonAttribute);
remover.acceptElement("u", commonAttribute);
remover.acceptElement("br", commonAttribute);
remover.acceptElement("hr", commonAttribute);
remover.acceptElement("sup", commonAttribute);
remover.acceptElement("sub", commonAttribute);
remover.acceptElement("strong", commonAttribute);
remover.acceptElement("em", commonAttribute);
remover.acceptElement("strike", commonAttribute);
remover.acceptElement("ol", commonAttribute);
remover.acceptElement("li", commonAttribute);
remover.acceptElement("ul", commonAttribute);
remover.acceptElement("h1", commonAttribute);
remover.acceptElement("h3", commonAttribute);
remover.acceptElement("h2", commonAttribute);
remover.acceptElement("h4", commonAttribute);
remover.acceptElement("h5", commonAttribute);
remover.acceptElement("span", commonAttribute);
remover.acceptElement("div", divAttribute);
remover.acceptElement("p", commonAttribute);
remover.acceptElement("a", aAttribute);
remover.acceptElement("img", imgAttribute);
remover.acceptElement("font", fontAttribute);
remover.acceptElement("table", tableAttribute);
remover.acceptElement("caption", commonAttribute);
remover.acceptElement("tr", tdAttribute);
remover.acceptElement("td", tdAttribute);
remover.acceptElement("bgsound", bgsoundAttribute);
remover.acceptElement("map", mapAttribute);
remover.acceptElement("area", areaAttribute);
remover.acceptElement("marquee", marqueeAttribute);
remover.acceptElement("blockquote", commonAttribute);
remover.acceptElement("cite", commonAttribute);
remover.removeElement("script");
remover.removeElement("style");
remover.removeElement("head");
remover.removeElement("select");
XMLDocumentFilter[] filters = { remover };
parser.setProperty(
"http://cyberneko.org/html/properties/default-encoding",
"GBK");
parser.setProperty("http://cyberneko.org/html/properties/filters",
filters);
HTMLDocument document = new HTMLDocumentImpl();
DocumentFragment fragment = document.createDocumentFragment();
InputSource is = new InputSource(new StringReader(str));
is.setEncoding("GBK");
parser.parse(is, fragment);
return getHTML(fragment, check).toString();
} catch (IOException e) {
// e.printStackTrace();
} catch (SAXException e) {
// e.printStackTrace();
} catch (Exception e) {
// ignore
}
return escapeHTML(str);
}
其中使用到了alibaba的几个类,
import com.alibaba.common.lang.ObjectUtil;
import com.alibaba.common.lang.StringEscapeUtil;
import com.alibaba.common.lang.i18n.LocaleUtil;
import com.alibaba.common.lang.internal.Entities;
import com.alibaba.common.lang.StringUtil;
package com.megaeyes.ipcamera.service.util;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.apache.commons.codec.binary.Base64;
import org.apache.html.dom.HTMLDocumentImpl;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.PatternMatcher;
import org.apache.oro.text.regex.PatternMatcherInput;
import org.apache.oro.text.regex.Perl5Compiler;
import org.apache.oro.text.regex.Perl5Matcher;
import org.apache.oro.text.regex.Perl5Substitution;
import org.apache.oro.text.regex.Util;
import org.apache.xerces.xni.parser.XMLDocumentFilter;
import org.cyberneko.html.filters.ElementRemover;
import org.cyberneko.html.parsers.DOMFragmentParser;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.html.HTMLDocument;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import com.alibaba.common.lang.ObjectUtil;
import com.alibaba.common.lang.StringEscapeUtil;
import com.alibaba.common.lang.i18n.LocaleUtil;
import com.alibaba.common.lang.internal.Entities;
import com.alibaba.common.lang.StringUtil;
public class TBStringUtil {
private static MessageDigest mHasher;
private static char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
private static Pattern escapeURLsInHTMLPattern = null;
private static Pattern escapeSpecialHTMLPattern = null;
private static String[] commonAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title" };
private static String[] divAttribute = new String[] { "align", "valign",
"class", "bgcolor", "background", "title" };
private static String[] imgAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title", "src",
"border", "width", "height", "alt", "usemap" };
private static String[] fontAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title", "color",
"size", "face" };
private static String[] tableAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title", "border",
"width", "height", "cellpadding", "cellspacing", "bordercolor",
"blockquote" };
private static String[] tdAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title", "width",
"height", "colspan", "rowspan" };
private static String[] marqueeAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title",
"scrollamount", "direction", "behavior", "width", "height",
"scrolldelay" };
private static String[] aAttribute = new String[] { "style", "align",
"valign", "class", "bgcolor", "background", "title", "target",
"name", "href" };
private static String[] bgsoundAttribute = new String[] { "src", "loop" };
private static String[] mapAttribute = new String[] { "name" };
private static String[] areaAttribute = new String[] { "href", "shape",
"coords" };
private static Set INLINE_CLOSED_TAG = new HashSet();
static {
INLINE_CLOSED_TAG.add("img");
INLINE_CLOSED_TAG.add("br");
INLINE_CLOSED_TAG.add("input");
try {
escapeURLsInHTMLPattern = (new Perl5Compiler())
.compile("(http://[a-zA-Z0-9_/&=?\\.;]*)");
escapeSpecialHTMLPattern = (new Perl5Compiler()).compile(
"^http://[a-z0-9]+\\.taobao\\.com.*$",
Perl5Compiler.CASE_INSENSITIVE_MASK);
} catch (Exception e) {
e.printStackTrace();
}
try {
mHasher = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException nex) {
mHasher = null;
nex.printStackTrace();
}
}
public static String hash(String str) {
byte[] bt = null;
synchronized (mHasher) {
bt = mHasher.digest(str.getBytes());
}
int l = bt.length;
char[] out = new char[l << 1];
for (int i = 0, j = 0; i < l; i++) {
out[j++] = digits[(0xF0 & bt[i]) >>> 4];
out[j++] = digits[0x0F & bt[i]];
}
return new String(out);
}
/**
* 转化字符串以适合html输出
*
* @param str
*
* @return
*/
public static String escapeHTML(String strInput) {
if (strInput == null) {
return "";
}
try {
StringWriter out = new StringWriter(strInput.length());
if (escapeEntities(Entities.HTML40, strInput, out)) {
return out.toString();
}
return strInput;
} catch (IOException e) {
return ""; // StringWriter不可能发生这个异常
}
}
/**
* 将字符串中的部分字符转换成实体编码。
*
* @param entities
* 实体集合
* @param str
* 要转义的字符串
* @param out
* 字符输出流,不能为<code>null</code>
*
* @return 如果字符串没有变化,则返回<code>false</code>
*
* @throws IllegalArgumentException
* 如果<code>entities</code>或输出流为<code>null</code>
* @throws IOException
* 如果输出失败
*/
protected static boolean escapeEntities(Entities entities, String str,
Writer out) throws IOException {
boolean needToChange = false;
if (entities == null) {
throw new IllegalArgumentException("The Entities must not be null");
}
if (out == null) {
throw new IllegalArgumentException("The Writer must not be null");
}
if (str == null) {
return needToChange;
}
for (int i = 0; i < str.length(); ++i) {
char ch = str.charAt(i);
String entityName = entities.getEntityName(ch);
if (entityName == null) {
if (ch == '\n') {
out.write('<');
out.write('b');
out.write('r');
out.write('/');
out.write('>');
// out.write(ch);
} else if (ch == '\r') {
// nodo
} else {
out.write(ch);
}
needToChange = true;
} else {
out.write('&');
out.write(entityName);
out.write(';');
// 设置改变标志
needToChange = true;
}
}
return needToChange;
}
/**
* 比较两个字符串是否相等,""与null相等 extends com.alibaba.common.lang.StringUtil
*
* @param str1
* @param str2
*
* @return
*/
public static boolean equals(String str1, String str2) {
if (StringUtil.isBlank(str1) && StringUtil.isBlank(str2)) {
return true;
}
return StringUtil.equals(str1, str2);
}
/**
* 去除特殊的HTML标记,自动补齐不完整的HTML
*
* @param String
* 转换前的HTML
*
* @return String 转换后的HTML
*/
public static String escapeSpecialHTML(String str) {
return escapeSpecialHTML(str, true);
}
/**
* 去除HTML标记
*
* @param str
* @return
*/
public static String stripHTML(String str) {
if (StringUtil.isBlank(str)) {
return "";
}
try {
DOMFragmentParser parser = new DOMFragmentParser();
// 标签过滤器
// acceptElement指接受那些html标签。removeElement表示那些标签会全部除去(包括子标签)。这两种之外的会去掉标签,但保留内容。
ElementRemover remover = new ElementRemover();
remover.removeElement("script");
remover.removeElement("style");
remover.removeElement("head");
remover.removeElement("select");
XMLDocumentFilter[] filters = { remover };
parser.setProperty("http://cyberneko.org/html/properties/filters",
filters);
HTMLDocument document = new HTMLDocumentImpl();
DocumentFragment fragment = document.createDocumentFragment();
InputSource is = new InputSource(new StringReader(str));
is.setEncoding("GBK");
parser.parse(is, fragment);
return getHTML(fragment, false).toString();
} catch (IOException e) {
// e.printStackTrace();
} catch (SAXException e) {
// e.printStackTrace();
} catch (Exception e) {
// ingore
}
return escapeHTML(str);
}
/**
* 去除特殊的HTML标记,自动补齐不完整的HTML
*
* @param String
* 转换前的HTML
* @param boolean
* forOutPut
* true:判断表格和链接是否合法。false:不判断。系统中发布宝贝的时候存入数据库前是true,显示宝贝的时候用的false
*
* @return String 转换后的HTML
*/
public static String escapeSpecialHTML(String str, boolean check) {
if (StringUtil.isBlank(str)) {
return "";
}
try {
DOMFragmentParser parser = new DOMFragmentParser();
// 标签过滤器
// acceptElement指接受那些html标签。removeElement表示那些标签会全部除去(包括子标签)。这两种之外的会去掉标签,但保留内容。
ElementRemover remover = new ElementRemover();
remover.acceptElement("b", commonAttribute);
remover.acceptElement("i", commonAttribute);
remover.acceptElement("u", commonAttribute);
remover.acceptElement("br", commonAttribute);
remover.acceptElement("hr", commonAttribute);
remover.acceptElement("sup", commonAttribute);
remover.acceptElement("sub", commonAttribute);
remover.acceptElement("strong", commonAttribute);
remover.acceptElement("em", commonAttribute);
remover.acceptElement("strike", commonAttribute);
remover.acceptElement("ol", commonAttribute);
remover.acceptElement("li", commonAttribute);
remover.acceptElement("ul", commonAttribute);
remover.acceptElement("h1", commonAttribute);
remover.acceptElement("h3", commonAttribute);
remover.acceptElement("h2", commonAttribute);
remover.acceptElement("h4", commonAttribute);
remover.acceptElement("h5", commonAttribute);
remover.acceptElement("span", commonAttribute);
remover.acceptElement("div", divAttribute);
remover.acceptElement("p", commonAttribute);
remover.acceptElement("a", aAttribute);
remover.acceptElement("img", imgAttribute);
remover.acceptElement("font", fontAttribute);
remover.acceptElement("table", tableAttribute);
remover.acceptElement("caption", commonAttribute);
remover.acceptElement("tr", tdAttribute);
remover.acceptElement("td", tdAttribute);
remover.acceptElement("bgsound", bgsoundAttribute);
remover.acceptElement("map", mapAttribute);
remover.acceptElement("area", areaAttribute);
remover.acceptElement("marquee", marqueeAttribute);
remover.acceptElement("blockquote", commonAttribute);
remover.acceptElement("cite", commonAttribute);
remover.removeElement("script");
remover.removeElement("style");
remover.removeElement("head");
remover.removeElement("select");
XMLDocumentFilter[] filters = { remover };
parser.setProperty(
"http://cyberneko.org/html/properties/default-encoding",
"GBK");
parser.setProperty("http://cyberneko.org/html/properties/filters",
filters);
HTMLDocument document = new HTMLDocumentImpl();
DocumentFragment fragment = document.createDocumentFragment();
InputSource is = new InputSource(new StringReader(str));
is.setEncoding("GBK");
parser.parse(is, fragment);
return getHTML(fragment, check).toString();
} catch (IOException e) {
// e.printStackTrace();
} catch (SAXException e) {
// e.printStackTrace();
} catch (Exception e) {
// ignore
}
return escapeHTML(str);
}
发表评论
-
Update Site will come soon
2021-06-02 04:10 1683I am still keep notes my tech n ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 433Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 440Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 377Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 458VPN Server 2020(2)Docker on Cen ... -
Nginx Deal with OPTIONS in HTTP Protocol
2020-02-15 01:33 362Nginx Deal with OPTIONS in HTTP ... -
PDF to HTML 2020(1)pdftohtml Linux tool or PDFBox
2020-01-29 07:37 418PDF to HTML 2020(1)pdftohtml Li ... -
Elasticsearch Cluster 2019(2)Kibana Issue or Upgrade
2020-01-12 03:25 724Elasticsearch Cluster 2019(2)Ki ... -
Spark Streaming 2020(1)Investigation
2020-01-08 07:19 298Spark Streaming 2020(1)Investig ... -
Hadoop Docker 2019 Version 3.2.1
2019-12-10 07:39 300Hadoop Docker 2019 Version 3.2. ... -
MongoDB 2019(3)Security and Auth
2019-11-16 06:48 246MongoDB 2019(3)Security and Aut ... -
MongoDB 2019(1)Install 4.2.1 Single and Cluster
2019-11-11 05:07 297MongoDB 2019(1) Follow this ht ... -
Monitor Tool 2019(1)Monit Installation and Usage
2019-10-17 08:22 329Monitor Tool 2019(1)Monit Insta ... -
Ansible 2019(1)Introduction and Installation on Ubuntu and CentOS
2019-10-12 06:15 318Ansible 2019(1)Introduction and ... -
Timezone and Time on All Servers and Docker Containers
2019-10-10 11:18 340Timezone and Time on All Server ... -
Kafka Cluster 2019(6) 3 Nodes Cluster on CentOS7
2019-10-05 23:28 291Kafka Cluster 2019(6) 3 Nodes C ... -
K8S Helm(1)Understand YAML and Kubectl Pod and Deployment
2019-10-01 01:21 334K8S Helm(1)Understand YAML and ... -
Rancher and k8s 2019(5)Private Registry
2019-09-27 03:25 372Rancher and k8s 2019(5)Private ... -
Jenkins 2019 Cluster(1)Version 2.194
2019-09-12 02:53 451Jenkins 2019 Cluster(1)Version ... -
Redis Cluster 2019(3)Redis Cluster on CentOS
2019-08-17 04:07 376Redis Cluster 2019(3)Redis Clus ...
相关推荐
**百度自动补齐**是一种常见的前端开发技术,主要应用于搜索引擎或者输入框中,为用户提供智能预测和建议,提高输入效率。这种功能通常被称为自动补全(Autocomplete)或自动完成(Auto-complete)。在JavaScript中...
"jQuery实现自动补齐"这个主题,主要涉及的是如何利用jQuery来创建一个功能强大的输入框自动完成功能,这在网页表单设计中十分常见,尤其对于搜索框或用户输入数据的场景,可以显著提升用户体验。 自动完成功能通常...
1. 过滤与匹配:通过`match`属性可以设置匹配规则,如忽略大小写、只匹配开头等。 2. 提示框样式:可以使用CSS自定义提示框的样式,如宽度、颜色、边距等。 3. 错误处理:当请求失败时,可以使用`error`回调进行...
本文实例讲述了PHP实现网页内容html标签补全和过滤的方法。分享给大家供大家参考,具体如下: 如果你的网页内容的html标签显示不全,有些表格标签不完整而导致页面混乱,或者把你的内容之外的局部html页面给包含进去了...
**jQuery实现Twitter的自动文字补齐特效** 在网页开发中,为用户提供友好的输入体验是至关重要的,其中一种常见的方式就是实现自动文字补全功能。这种功能常见于搜索引擎、社交媒体平台等,比如Twitter。jQuery,一...
在Java开发中,实现自动补全功能是一种常见的需求,特别是在Web应用中,它可以极大地提高用户输入的效率和体验。这个项目使用了Java后端技术和AJAX前端技术来完成这一功能。接下来,我们将深入探讨如何利用Java和...
然后,它使用substr方法截取手机号的前部分,并用重复的星号字符串补齐到指定长度,最终返回被隐藏处理过的手机号字符串。 6. 数据展示:在HTML模板中,通过使用过滤器标记(|)和过滤器名称(truncate),以及传递...
田字格是一种传统的汉字练习模板,帮助学习者准确掌握汉字的笔画顺序和位置。这个源码包可能是为了方便教育工作者或者编程爱好者快速创建个性化的汉字学习资源。 在PHP的世界里,源码通常包含了处理请求、动态生成...
nginx/Windows使用工作目录作为前缀将配置文件中设置的相对目录补齐。就上面安装的例子而言,工作目录应该是C:\nginx-1.3.13\(工作目录基本上与运行文件所在的目录相同)。配置文件中的目录请使用“/”,而不是“\...
每个模版都可定义不同的样式,所以系统内置的功能的相关文件也都放在了模版里,每个模版里存储一份,避免替换系统目录下的其他文件。 ads/ 存放广告js文件,可自定义名称, 在当前模版路径的config.xml 里配置好 ...
重点2:规则可以叠加,前面文本和后面文本相对应,从外往内,一层一层提取。也就是循环取中间文本。 BUG记录: 1、在核心功能—>提取链接这个子程序中,对于HTTP网址是否需要补齐根域名存在1个判断BUG。 2、在核心...
评论对不齐、以及打开新品和特价等页面的布局bug; 支持单独设置管理员自定义页面管理权限; 会员登录名字大小写不同,管理文章时出错; 过滤保存关键字时出现空关键字的情况; 用户注册判断用户名长短,是否禁止...
//请在以下补齐代码用来调用OnDBOperate委托签名的OnNew事件。 } } } 答:if( OnNew != null ) OnNew( this, e ); 27.分析以下代码,完成填空 string strTmp = \"abcdefg某某某\"; int i= System.Text....