我在一个战争档案中部署了几个主题。主题位于 /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"/>
同样的结果,“关于:空白”。我也尝试了各种不同的门户逻辑: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 文档完全没用。这是关于信息中心中记录的所有内容,我还没有遇到任何更有用的东西。反编译 IBM jar:s 几乎已成为我的第二天性,但尝试遵循门户中的内部查找器逻辑只会让我非常头疼。
那么,有没有人能够从主题应用程序内部访问外部资源?你会认为这是通常做的事情,但我开始怀疑。