有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java小程序不显示在SpringWeb项目的jsp上

我正在使用spring安全性开发一个spring mvc web项目。我还开发了一个Java小程序,它可以在浏览器中的html文件中正常工作(小程序也由jarsigner签名)。现在我想将其包含在spring web项目的jsp文件中,因此我在jsp文件中使用了如下标记:

<jsp:plugin type="applet" archive="MutualAuthentication.jar" 
    code="MutualAuthenticationHTTPApplet.class" codebase="." width="400" height="300">
</jsp:plugin> 

我研究了其他的例子,但运气不好。一切都在tomcat服务器上运行,tomcat给我的消息如下:

Jan 16, 2014 3:09:24 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/tkey/MutualAuthentication.jar] in DispatcherServlet with name 'mvc-dispatcher'
Jan 16, 2014 3:09:24 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/tkey/MutualAuthentication.jar] in DispatcherServlet with name 'mvc-dispatcher'
Jan 16, 2014 3:09:24 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/tkey/MutualAuthentication.jar] in DispatcherServlet with name 'mvc-dispatcher'
Jan 16, 2014 3:09:24 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/tkey/MutualAuthentication.jar] in DispatcherServlet with name 'mvc-dispatcher'
Jan 16, 2014 3:09:24 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/tkey/MutualAuthenticationHTTPApplet.class] in DispatcherServlet with name 'mvc-dispatcher'
Jan 16, 2014 3:09:24 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/tkey/MutualAuthenticationHTTPApplet/class.class] in DispatcherServlet with name 'mvc-dispatcher'

我的小程序位于以下位置:

src    
    |--main
        |--webapp
            |--WEB-INF
                |--pages
                    |--*.jsp
                |--mvc-dispatcher-servlet.xml
                |--spring-security.xml
                |--web.xml
            |--index.jsp
            |--MutualAuthentication.jar

我认为这与{}和{}有关,但我不能以正确的方式得到它

所以我的问题是,如何在SpringMVC/SecurityWebProject的jsp中包含小程序


共 (1) 个答案

  1. # 1 楼答案

    好吧,我也有同样的问题。。。我花了几个小时尝试不同的组合,这对我很有用:

    请输入YourAppletName。在webapp/resources中,请确保 <resources mapping="/resources/**" location="/resources/" />在servlet上下文中

    使用以下命令调用小程序:

    <object type="application/x-java-applet" height="300" width="550">
    <param name="code" value="<c:url value="your.package.name.YourAppletClass"/>" />
    <param name="class" value="<c:url value="your.package.name.YourApplet.class"/>" />
    <param name="archive" value="<c:url value="resources/YourAppletName.jar"/>"/>
    Applet failed to run.  No Java plug-in was found.
    </object>
    

    希望这有帮助