瀏覽器會話,我們有啓用的tomcat6基本身份驗證。用戶在瀏覽器中進行身份驗證,然後啓動JNLP以在Java Web Start中啓動應用程序。在啓動時,java web start嘗試從服務器下載jar文件,但它沒有使用已被瀏覽器認證的同一會話。基於論壇,我試圖通過使用sid屬性在JNLP中傳遞會話ID以及在URL中追加。環境受到限制,因此每個請求都需要進行身份驗證,我們不能說排除對未被驗證的jar文件的請求。下面是我的JSP創建JNLP文件,任何人都可以請幫助我們如何繼續同一會話來下載已被瀏覽器認證的jar。繼續JNLP
<% response.setContentType("application/x-java-jnlp-file"); %>
<%= "<?xml version=\"1.0\" encoding=\"utf-8\"?>" %>
<!-- JNLP File for SimpleTableDemo -->
<%
String baseURL = request.getRequestURL().toString().replace(request.getRequestURI(), request.getContextPath());
%>
<jnlp codebase="<%=baseURL%>">
<information>
<title>Simple Table Demo Application</title>
<vendor>Try</vendor>
<description>SimpleTableDemo</description>
<description kind="short">An application that demonstrates a simple table.</description>
</information>
<resources>
<j2se version="1.6+" />
<property name="sid" value="<%=request.getSession().getId()%>" />
<property name="serviceHost" value="<%=request.getServerName()%>"/>
<property name="servicePort" value="<%=request.getServerPort()%>"/>
<jar href="AuthenticateJNLPJars.jar;JSESSIONID=<%=request.getSession().getId()%>" />
</resources>
<application-desc main-class="SimpleTableDemo" >
</application-desc>
</jnlp>
我正在通過代碼中提到的側參數的會話ID。如果我的應用程序發出服務器請求,但可以使用這些參數,但JWS在從服務器下載jar文件時未使用該參數。這是問題 – Stauz 2013-05-01 10:31:33