WebSphere Portal 6.1.5主题门户网站逻辑:findUrlInTheme,找到主题外的资源的url

时间:2011-08-04 12:50:09

标签: jsp websphere websphere-portal

我正在一个战争档案中部署几个主题。主题位于/ themes / html /下的webapp中。我正在尝试使用不同的主题来创建“公共”文件夹中的资源链接,该文件夹本身不是主题,而是放在/ themes / html / common中。具体来说,我的主题Default.jsp应该链接到公共文件夹中的脚本,图像和样式表。

到目前为止,我一直在尝试几种不同的方法

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

没有运气,只需打印“about:blank”作为href

然后我尝试注册公共文件夹作为它自己的主题(“称为CommonResources”)并尝试

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

相同的结果,“约:空白”。 我也尝试过各种各样的门户逻辑: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中的空字符串。

另外,我试过这个

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

问题在于request.getContextPath()返回一个空字符串。我可以将上下文硬编码到主题应用程序中,但出于显而易见的原因,我宁愿避免这种情况。

像往常一样,IBM文档完全没用。 This是关于信息中心记录的所有内容,我无法找到更有用的内容。反汇编IBM jar:s几乎成了我的第二天性,但是试图遵循门户网站中的内部查找器逻辑只会让我头疼。

那么,有没有人有幸从主题应用程序内部访问外部资源?你认为这是常见的事情,但我开始怀疑。

1 个答案:

答案 0 :(得分:0)

回答我自己的问题......

原来问题是在WAS内部的网址缓存。

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

是正确的并且有效。我的问题是websphere已经缓存了/common/styles/main.css在之前的请求中不存在(在我部署它之前)。似乎这些URL缓存不会因为您重新部署应用程序而被清除。我将文件夹名称更改为common2并重新部署,以强制WebSphere重新运行内部查找程序然后它可以工作。

相关问题