【问题标题】:WebSphere Portal 6.1.5 theme portal-logic:findUrlInTheme, find url to resource outside themeWebSphere Portal 6.1.5 主题portal-logic:findUrlInTheme,找到主题外资源的url
【发布时间】:2011-08-04 12:50:08
【问题描述】:

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

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

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

不走运,只是将“about:blank”打印为 href

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

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

同样的结果,“about:blank”。 我也尝试过各种不同的 portal-logic: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 几乎已成为我的第二天性,但尝试遵循门户中的内部查找器逻辑让我非常头疼。

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

【问题讨论】:

    标签: jsp websphere websphere-portal


    【解决方案1】:

    回答我自己的问题...

    原来问题在于 WAS 中的 url 缓存。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多