0

我在我的应用程序中成功签名并部署了一个小程序。

index.html如果我拨打电话,我有一个正确加载小程序的/myApp

但是,如果我尝试index.html从 servlet 转发,我会得到一个ClassNotFoundException.

这是加载小程序的代码。所有这些罐子都在 WebContent 文件夹中。

索引.html

<applet code="com.griaule.grFingerSample.FormMain"
  archive="fingerAssinado.jar,SignedGrFingerJavaAppletSampleAssinado.jar,postgresql-8.4-701.jdbc4Assinado.jar"
</applet>

我究竟做错了什么?

4

1 回答 1

1

Any relative paths in archive attribute of HTML <applet> element are relative to the current request URL (the one as the client see in browser's address bar), not to the physical server's disk file system location of the JSP file responsible for generating the HTML output, as many starters incorrectly think.

So, if you fix the relative paths in to be properly relative to the current request URL, then it should work fine. You can if necessary make use of ${pageContext.request.contextPath} to dynamically print the current context path.

<c:set var="root" value="${pageContext.request.contextPath}" />
<applet ... archive="${root}/fingerAssinado.jar, ..." />

This way you can make it relative to the domain root.

See also:

于 2013-10-02T15:31:27.420 回答