需要在 XPage 应用程序的登录页面上禁用加载资源 [英] Need to disable loading resources on login page of XPages application

查看:35
本文介绍了需要在 XPage 应用程序的登录页面上禁用加载资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在对应用程序中的间歇性 403 错误进行故障排除.出现的问题之一是我们正在登录页面上加载资源.这些资源会在我们的集成环境中间歇性地产生 401 错误.在用户登录应用程序之前,这些都不需要.

We are in the midst of troubleshooting intermittent 403 errors in our application. One of the issues that came up was that we are loading resources on our login page. The resources intermittently produce 401 errors in our Integration environment. None of these are needed until after the user has logged into the application.

所有这些资源都存储在 NSF 中,没有一个使用 CDN.这些资源通过每个页面上的主题加载.

All of these resources are stored in the NSF, none use a CDN. These resources are loaded via a Theme on every page.

当然,我认为解决方案是禁用登录 XPage 的主题.我开始在 <xp:view> 标签上设置 disableTheme="true" .由于某种原因,这不起作用,资源仍然加载在页面上.

Naturally, I thought the solution was to disable the theme of the login XPage. I went about setting disableTheme="true" on the <xp:view> tag. For some reason this did not work and the resources are still loaded on the page.

谁能建议如何确保资源没有加载到这个特定页面上?

Can anyone suggest how to make sure the resources are NOT loaded on this particular page?

推荐答案

当 NSF 的 ACL 设置为匿名用户无权访问.解决此问题的几种方法是:

It seems that resources contained within the WebContent/ path of an NSF are still protected and require login when that NSF's ACL is set to no access for Anonymous. A couple of ways to get around this are:

  1. 从服务器的/domino/... 路径(html、js、lib、图标)托管资源文件
  2. 从 CDN 加载这些资源
  3. 使用替代主题(结果喜忧参半,请参阅 OP 问题的评论主题)
  4. 计算单个resource(或resources)标签以呈现,但登录页面除外
  1. host the resource files from the server's /domino/... path (html, js, lib, icons)
  2. load those resources from a CDN
  3. use an alternate theme (mixed results, see the comment thread on the OP's question)
  4. computing the individual resource's (or resources) tag to render for all but a login page

作为 Per HenrikLausten 在另一篇文章中回答了,解决方案 #4 的实现实际上是:

As Per Henrik Lausten answered on another post, the implementation with the solution #4 would effectively be:

<resource rendered="#{javascript:view.getPageName() != '/login.xsp'}">
    <content-type>application/x-javascript</content-type>
    <href>js/jquery-1.11.1.min.css</href>
</resource>

这篇关于需要在 XPage 应用程序的登录页面上禁用加载资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆