在 dwr.xml 中如何从全局过滤器中排除某些类?

发布于 2024-10-10 19:12:33 字数 344 浏览 0 评论 0原文

可以在DWR(直接网络远程处理)中创建全局过滤器。例如,如果您需要检查用户是否登录,您可以将其写在一个地方 - 过滤器中,在 dwr.xml 中将其指示为全局过滤器:

<allow>
  ....
  <filter class="mypackage.MyFilterClass"/>
  ....
</allow>

但是有些类允许用户使用没有身份验证,例如身份验证类本身。我想知道如何在全局过滤器标记中指示我不希望过滤(排除)哪些类?

There is possibility to make global filter in DWR (direct web remoting). For example if you need to check if user is logged in, you write it in one place - in filter, that is indicated it in dwr.xml as global filter:

<allow>
  ....
  <filter class="mypackage.MyFilterClass"/>
  ....
</allow>

But there are classes that user is allowed without authentication, for example authentication class itself. I want to know how to indicate in global filter tag what class or classes I want not to be filtered (excluded)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

濫情▎り 2024-10-17 19:12:33

您可以将异常类作为参数传递给您的过滤器。在您的过滤器中,您可以检查此参数并对此类执行 noop。

<filter class="org.mypackage.MyFilter">
  <param name="excluded" value="org.mypackage.MyClass"/>
</filter>

You can pass the exceptional class as parameter to your filter. In your filter you can check against this parameter and do noop for this class.

<filter class="org.mypackage.MyFilter">
  <param name="excluded" value="org.mypackage.MyClass"/>
</filter>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文