在 ASP.NET MVC 应用程序中运行 java applet
我有一个在 ASP.NET Web 应用程序中运行没有问题的小程序... 但是当谈到 ASP.MVC 应用程序时..这里小程序无法正常工作并抛出类未找到异常 请告诉我是否有人能够在 MVC 应用程序中运行小程序。下面是
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F4345D93"
codebase="http://java.sun.com/update/1.6.0/jinstall-6u11-windows-i586.cab#Version=6,0,0,11" id="DeviceControl">
<param name="java_arguments" value="-Xmx256m" />
<param name="CODE" value="/com/XYZ/application/main/SomeApplet.class" />
<param name="archive" value="all jar path" />
<param name="type" value="application/x-java-applet;version=1.6" />
<param name="scriptable" value="true" />
<param name="mayscript" value="true" />
</object>
我正在加载的
视图异常中的代码:未找到类 com.AppName.scanner.main.ScannerApplet.class。 java.lang.ClassNotFoundException:com.XYZ.application.main.SomeApplet.class 在 sun.plugin2.applet.Applet2ClassLoader.findClass(来源未知) 在 java.lang.ClassLoader.loadClass(来源未知) 在 java.lang.ClassLoader.loadClass(来源未知) 在 sun.plugin2.applet.Plugin2ClassLoader.loadCode(来源未知) 在 sun.plugin2.applet.Plugin2Manager.createApplet(来源未知) 在 sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(来源未知) 在 java.lang.Thread.run(来源未知) 引起原因:java.io.IOException:打开HTTP连接失败:http: //localhost:3213/Appname/com/XYZ/application/main/SomeApplet/class at sun.plugin2.applet.Applet2ClassLoader.getBytes(来源未知) 在 sun.plugin2.applet.Applet2ClassLoader.access$000(来源未知) 在 sun.plugin2.applet.Applet2ClassLoader$1.run(来源未知) 在 java.security.AccessController.doPrivileged(本机方法) ... 7 更多
I have a applet that runs with no issue in asp.net web application ...
but when comes to ASP.MVC application ..here applet is not working throwing class not founnd exception
please let me know if anyone could able to run applet in MVC application .. below is the code from view
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F4345D93"
codebase="http://java.sun.com/update/1.6.0/jinstall-6u11-windows-i586.cab#Version=6,0,0,11" id="DeviceControl">
<param name="java_arguments" value="-Xmx256m" />
<param name="CODE" value="/com/XYZ/application/main/SomeApplet.class" />
<param name="archive" value="all jar path" />
<param name="type" value="application/x-java-applet;version=1.6" />
<param name="scriptable" value="true" />
<param name="mayscript" value="true" />
</object>
exception that i am gettting is
load: class com.AppName.scanner.main.ScannerApplet.class not found.
java.lang.ClassNotFoundException: com.XYZ.application.main.SomeApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://localhost:3213/Appname/com/XYZ/application/main/SomeApplet/class at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在我看来,您需要一个代码库参数:
如果小程序与网页不在同一位置,则需要代码库参数。这不是页面在服务器上的物理位置,而是与用于访问页面的 URL 相同的目录。
以下是有关托管小程序所需参数的一些信息:
http://java.sun.com/ j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html
It looks to me like you need a codebase param:
Codebase param is required if the applet is not in the same location as the webpage. This is not the physical location of the page on the server but the same directory as far as the url that is used to access the page is concerned.
Here is some info on the parameters needed to host an applet:
http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html
尝试在浏览器中手动加载类文件。
我猜想路由失败,因此该类没有传递给客户端。 (404错误)如果是这种情况,你必须调整你的asp.net mvc路由内容。 :)
以下是有关 ASP.NET MVC 中路由的一些基本信息。
http://www.asp.net/Learn/mvc/tutorial- 05-cs.aspx
您应该检查您的 global.asax(.cs) 文件,并可能为您的类文件添加 IgnoreRoute。
Try manually loading the class file in your browser.
I guess that the routing fails, and so the class isn't delivered to the client. (404 error) If thats the case, you have to adjust your asp.net mvc routing stuff. :)
Here are some basic infos on routing in asp.net mvc.
http://www.asp.net/Learn/mvc/tutorial-05-cs.aspx
You should check your global.asax(.cs) file, and possibly add a IgnoreRoute for your class file.
告诉 MVC 不要处理 .class 文件的请求。我认为应该这样做:
Tell MVC not to process requests for .class files. I think this should do it: