2014-01-16 39 views
1

我開發了一個spring彈簧安全的mvc web項目。我還開發了一個Java Applet,它在HTML文件的瀏覽器中正常工作(Applet也使用jarsigner簽名)。現在我想包括在在彈簧Web項目的JSP文件,所以我用了標籤作爲遵循的JSP文件:Applet不會顯示在jsp上的彈簧web項目

<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 

我認爲這事做DispatcherServletMapping,但我無法以正確的方式得到它。

所以我的問題是,我怎麼能包括一個小程序在彈簧mvc /安全webProject的jsp上?

回答

0

好吧,我有同樣的問題。我已經花了幾個嘗試不同的組合小時,這對我的作品:

把YourAppletName.jar在webapp /資源,一定要有 <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> 

希望這有助於