小程序加载认证 [英] Applet loading authentication

查看:38
本文介绍了小程序加载认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在 IIS 7.5 上运行且集成了 Windows 身份验证的网站.在 /Content 文件夹(匿名访问)中有一个小程序 - MyApplet.jar.使用此小程序时,Java 会显示需要身份验证"弹出窗口(即使我选中记住"复选框,此弹出窗口也不会记住我的密码).

I have a web site running on IIS 7.5 with integrated Windows authentication. In /Content folder (with anonymous access) there is an applet - MyApplet.jar. When using this applet, Java shows "Authentication required" popup (and this popup does not remember my password even if I check "remember" check-box).

有没有办法去掉这个窗口?

Is there any way to remove this window?

这是加载小程序之前的Java控制台:

This is Java console before loading applet:

network: Cache entry not found [url: http://192.168.10.136/Web/Examination.mvc/Details/PatientEHR/META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration, version: null]
network: Connecting http://192.168.10.136/Web/Examination.mvc/Details/PatientEHR/META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration with proxy=DIRECT
network: Connecting http://192.168.10.136:80/ with proxy=DIRECT
network: Connecting http://192.168.10.136/Web/Examination.mvc/Details/PatientEHR/META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration with cookie "JCP-store=HDImageStore; JCP-key=Inf_WOPass"
network: Firewall authentication: site=/192.168.10.136:80, protocol=http, prompt=, scheme=ntlm

推荐答案

我看起来你的 Applet 正在做一些 XML 解析.如果是这样,发生的事情是 Java 正在寻找一个 XML 解析器(使用 getClass().getResource(...))并且作为您的小程序的路径,它将向您的服务器执行 HTTP 请求.

I looks like your Applet is doing some XML parsing. If so, what is happening is that Java is looking for a XML parser (with getClass().getResource(...)) and as the path of your applet, it will perform a HTTP request to your server.

为了防止它,您可能需要在小程序的 init 方法中定义 XML 解析器

To prevent it you may want to define the XML parser in the init method of your applet with

 Class.forName("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
 System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");

从 Java6u10 开始,您还可以选择使用

Since Java6u10 you also have the option to remove the path of your Applet from the classpath (but not the Applet) with

<APPLET ...>
    <PARAM name="codebase_lookup" value="false">
</APPLET>

安东尼

这篇关于小程序加载认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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