JNLP arguments in IIS

1.2k Views Asked by At

I have a Java web start application that receives one argument. So using a apache tomcat server and all i need to do is to create a JSP file, get the request parameter and send it to the Java application just like the code bellow:

<%@ page contentType="application/x-java-jnlp-file" %>   
<%@ page session="true" %>   
<%   
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server 
// Getting the URL parameters from the request
final String PARAM = "docId";
String paramDocId = request.getParameter(PARAM);
%> 

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="printerwebdoc.jsp?<%=PARAM + "=" + paramDocId%>">

     <information>
          <title>Web Doc Printer</title>
          <vendor>Ambisig</vendor>
          <description>Web Doc Printer</description>
     </information>

     <security>
          <all-permissions/>
     </security>

     <resources>
          <j2se version="1.6+" />
          <jar href="webdocprinter.jar" />
     </resources>

    <application-desc main-class="main.gui.Main">
        <argument><%=paramDocId%></argument>
    </application-desc>
</jnlp>

The problem is that now i need to run this application on a IIS server and the JSP doesn't work in this condition.

What can i do to pass the argument to my Java web start application using IIS?

1

There are 1 best solutions below

5
On

As @Andrew Thompson said i used an ASP file to run my JNLP and here's the code:

<% 
 dim PARAM
 PARAM = "docId"
 response.ContentType="application/x-java-jnlp-file"
 dim paramDocId
 paramDocId = request.querystring("docId")
 dim ipAddress
 ipAddress = Request.ServerVariables("server_name") 
%>


<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://<%=ipAddress+"/Java/"%>" href="webdocprinter.asp?<%=PARAM + "=" + paramDocId%>">

     <information>
          <title>Web Doc Printer</title>
          <vendor>Ambisig</vendor>
          <description>Web Doc Printer</description>
     </information>

     <security>
          <all-permissions/>
     </security>

     <resources>
          <j2se version="1.6+" />
          <jar href="webdocprinter.jar" />
     </resources>

    <application-desc main-class="main.gui.Main">
        <argument><%=paramDocId%></argument>
   </application-desc>
</jnlp>

With this solution i can run a receiving arguments Java Web Start application within an IIS server!

Thank you