2011-08-04 34 views
1

我在一個war檔案中部署了幾個主題。主題位於/applications/html/下的webapp中。我試圖讓不同的主題創建鏈接到「共同」文件夾中的資源,該文件夾本身不是主題,而是放置在/ themes/html/common中。具體來說,我的主題Default.jsp應鏈接到公用文件夾中的腳本,圖像和樣式表。WebSphere Portal 6.1.5主題門戶邏輯:findUrlInTheme,找到主題外的資源url

到目前爲止,我一直在嘗試幾種不同的方法

<link href='<portal-logic:urlFindInTheme file="../common/styles/main.css" />' type="text/css" rel="stylesheet"/> 

沒有運氣,只需打印出「有關:空白」爲HREF

然後,我註冊的共同文件夾,因爲它是自己的主題(試行「稱爲CommonResources」)並嘗試

<link href='<portal-logic:urlFindInTheme file="/styles/main.css" theme="CommonResources"/>' type="text/css" rel="stylesheet"/> 

相同的結果「about:blank」。 我也曾嘗試門戶網站邏輯的各種變化:urlFind

<link href='<portal-logic:urlFind file="../common/styles/main.css" />' type="text/css" rel="stylesheet"/> 
<link href='<portal-logic:urlFind file="/common/styles/main.css" />' type="text/css" rel="stylesheet"/> 
<link href='<portal-logic:urlFind file="main.css" path="/common/styles" />' type="text/css" rel="stylesheet"/> 
<link href='<portal-logic:urlFind file="main.css" path="/common/styles" root="/" />' type="text/css" rel="stylesheet"/> 
<link href='<portal-logic:urlFind file="main.css" path="/styles" root="/common" />' type="text/css" rel="stylesheet"/> 

同樣存在,沒有運氣。這些不會導致:空白,只是在href中的空字符串。

Alternativly,我想這

<link href="<%= request.getContextPath() %>/themes/html/common/styles/main.css" type="text/css" rel="stylesheet" /> 

問題的那就是request.getContextPath()返回一個空字符串。我可以將上下文硬編碼到主題應用程序,但由於顯而易見的原因,我寧願避免這種情況。

與往常一樣,IBM文檔完全沒用。 This是關於信息中心記錄的所有內容,我無法找到更有用的東西。反編譯IBM jar對我而言幾乎成了第二性質,但試圖遵循門戶內部的查找器邏輯,給我帶來了巨大的麻煩。

那麼,有沒有人有任何運氣從主題應用程序內訪問外部資源?你會認爲這是通常做的事情,但我開始懷疑。

回答

0

回答我的問題...

原來,問題是URL緩存內了。

<link href='<portal-logic:urlFindInTheme file="../common/styles/main.css" />' type="text/css" rel="stylesheet"/> 

是否正確,有效。我的問題是,websphere已經緩存了/common/styles/main.css在之前的請求中不存在(在我部署之前)。似乎這些URL緩存不會因爲您重新部署應用程序而被清除。我將文件夾名稱更改爲common2並重新部署,以強制WebSphere重新運行內部查找程序,然後運行。

相關問題