liferay過濾器(四)

2021-08-31 14:55:44 字數 1744 閱讀 4516

1、themepreviewfilter過濾器

主要**:

themedisplay themedisplay = (themedisplay)request.getattribute(

webkeys.theme_display);

pattern csspattern = pattern.compile(

themedisplay.getpaththemecss());

matcher cssmatcher = csspattern.matcher(content);

content = cssmatcher.replaceall("css");

pattern imagepattern = pattern.compile(

themedisplay.getpaththemeimages());

matcher imagematcher = imagepattern.matcher(content);

content = imagematcher.replaceall("images");

功能:判斷是否是要預覽,如果是預覽,替換response中的themedisplay.getpaththemecss()為「css」,themedisplay.getpaththemeimages()為「images」。(預覽時不載入layout)

2、sharepoint過濾器

主要**:

}主要功能:設定返回的html的頭協議。

3、virtualhostfilter 過濾器

主要**:

string friendlyurl = request.getrequesturi();

if ((validator.isnotnull(contextpath)) &&

(friendlyurl.indexof(contextpath) != -1))

friendlyurl = stringutil.replace(

friendlyurl, stringpool.double_slash, stringpool.slash);

4、threadlocalfilter過濾器

主要**:

if (threadlocalset == null)

for (threadlocal<?> threadlocal : threadlocalset)

功能:使用者請求完成後,從執行緒池中移除此執行緒

5、stripfilter 過濾器

主要**:

boolean skipped = false;

for (int i = charbuffer.position(); i < charbuffer.limit(); i++)

else

}if (skipped)

主要功能:去掉空行,加快頁面的展示速度。

Vue 過濾器案例(全域性過濾器和區域性過濾器)

doctype html en utf 8 viewport content width device width,initial scale 1.0 js vue 2.4.0 js script 過濾器 title head 兩個過濾器的名稱都為msgformat,但是控制不同作用,乙個是全域性的...

過濾器(6) 過濾器的攔截

本系列部落格彙總在這裡 過濾器彙總 我們來做個測試,寫乙個過濾器,指定過濾的資源為 index.jsp,然後我們在瀏覽器中直接訪問 index.jsp,你會發現過濾器執行了!但是,當我們在 helloservlet 中使用伺服器端的跳轉request.getrequestdispathcer ind...

hbase 過濾器 scala 過濾器系列

過濾器系列710 c30810 賓士 c64 1500 004 09411 04 004094 3504 h12 110 2 w11102 2 wdk724 wdk725 沃爾沃 3825778 8149064 3825133 3825215 466634 11110668 11711074 477...