我开发了一个带有弹簧安全性的spring mvc web项目。我还开发了一个Java Applet,它在浏览器中的html文件中运行良好(Applet也与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'
我的Applet位于以下位置:
src
|--main
|--webapp
|--WEB-INF
|--pages
|--*.jsp
|--mvc-dispatcher-servlet.xml
|--spring-security.xml
|--web.xml
|--index.jsp
|--MutualAuthentication.jar
我认为它与DispatcherServlet
和Mapping
有关,但我无法以正确的方式得到它。
所以我的问题是,如何在spring mvc / security webProject上的jsp中包含一个Applet?
答案 0 :(得分:0)
将YourAppletName.jar放在webapp / resources中,一定要有
servlet-context中的<resources mapping="/resources/**" location="/resources/" />
使用以下命令调用applet:
<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>
希望这会有所帮助