java ÕýÔò±í´ïʽ¹ýÂËhtmlÔªËØ
ÏÂÃæÊÇÒ»¸ö¹ýÂËhtmlÔªËصijÌÐò£¬Ò²Ðí¶Ô´ó¼ÒÓеã°ïÖú£¡
/**
* filter all html element.
* For example:<a href="www.sohu.com/test">hello!</a>
* The filter result is :hello!
* Notice:This method filter the text between "<" and ">"
* @param element
* @return
*/
public static String getTxtWithoutHTMLElement (String element)
{
// String reg="<[^<|^>]+>";
// return element.replaceAll(reg,"");
if(null==element||"".equals(element.trim()))
{
return element;
}
Pattern pattern=Pattern.compile("<[^<|^>]*>");
Matcher matcher=pattern.matcher(element);
StringBuffer txt=new StringBuffer();
while(matcher.find())
{
String group=matcher.group();
if(group.matches("<[\\s]*>"))
{
matcher.appendReplacement(txt,group);
Ïà¹ØÎĵµ£º
2£®DOMʵÀý
ÓÐÁËÉÏÃæµÄ½éÉÜ£¬ÏàÐÅÄã¶ÔDOMÀí½âµÄ¸ü¶àÁË°É¡£ÏÂÃæµÄÀý×Ó½«ÈÃÄã¶ÔDOM¸ü¼ÓÊìϤÆðÀ´¡£
ÏÈ˵˵Õâ¸öÀý×Óµ½µ×Òª×öµÄÊÇʲô°É£¬ÎÒÃÇÏ£ÍûÔÚÒ»¸öÃûΪlink.xmlÎļþÖб£´æÁËһЩURLµØÖ·£¬Í¨¹ýÒ»¸ö¼òµ¥µÄ³ÌÐò£¬ÎÒÃÇ¿ÉÒÔͨ¹ýDOM°ÑÕâЩURL¶Á³ö²¢ÏÔʾ³öÀ´£¬Ò²¿ÉÒÔ·´¹ýÀ´ÏòÕâ¸öXMLÎļþÖÐдÈë¼ÓÈëµÄURLµØÖ·¡£ºÜ¼òµ¥£¬È´ºÜÊµÓ ......
ÔÚ¿ª·¢¹ý³ÌÖУ¬ºÜ¿ÉÄÜ»áÓöµ½ÐèÒª¹ýÂ˵ô×Ö·û´®ÖеÄÑùʽ´úÂë»òÕß»»Ðлسµ·ûµÈµÈµÄÇé¿ö£¬ÎÒ¾ÍÓöµ½¹ýÀàËƵÄÇé¿ö£¬ËùÒԾͰѹýÂ˵ôhtml´úÂëµÄ·½·¨Ìùµ½²©¿ÍÉÏ£¬Áô¸ö±ê¼Ç£¬Ï£Íû»á¶ÔÅóÓÑÃÇÓÐËù°ïÖú£º
String str = "<p>dfsdsdfsdf</p>sdgfsg<b>sdgfsdgrrytrfh</b>\r\r\n";
String ss = str.replaceAl ......
ÔÚhtmlÎļþÒýÈëÆäËühtmlÎļþµÄ¼¸ÖÖ·½·¨
¼ò½é£ºÔÚÂÛ̳Öг£³£ÓÐÍøÓÑÎʵ½£¬¿ÉÒÔÔÚÒ»¸öhtmlµÄÎļþµ±ÖжÁÈ¡ÁíÒ»¸öhtmlÎļþµÄÄÚÈÝÂ𣿴ð°¸ÊÇÈ·¶¨µÄ£¬¶øÇÒ·½·¨²»Ö»Ò»ÖÖ£¬ÔÚÒÔÇ°ÎÒÖ»»áʹÓÃiframeÀ´ÒýÓ㬺óÀ´·¢ÏÖÁËÁíÍâµÄ¼¸ÖÖ·½·¨£¬ÄǽñÌì¾Í×ܽáÕ⼸ÖÖ·½·¨Èôó¼Ò²Î¿¼Ò»Ï£¬±¾È˾õµÃµÚÈýÖÖ·½Ê½½ÏºÃ£¡
1.IFrameÒýÈ룬¿´¿´ÏÂÃæµÄ´ú ......
Ò»¡¢JSP_Ñ¡ÔñÌâ
1. ÒÔÏÂÑ¡ÏîÖв»ÊÇjspÒþʽ¶ÔÏóµÄÊÇ£º£¨ £©
A pageContext
B context
C application
D out
²Î¿¼´ð°¸£ºB
2. ÏÂÃæÄÄÒ»¸ö²»ÊÇJSP±¾ÉíÒѼÓÔصĻù±¾Àࣿ£¨ £©
A java.lang.*
B java.io.*
C javax.servlet.*
D javax.servlet.j ......