Sunday, April 17, 2016

set param value of jnlp dynamically

Leave a Comment

I am trying to launch applet using JNLP. I want to pass some parameter dynamically to applet. My JNLP file looks like

<?xml version="1.0" encoding="UTF-8"?>     <jnlp spec="1.0+" codebase="http://localhost:8080/WebAppTest/jar/" href="">         <information>             <title>JNLP Test</title>             <vendor>Java</vendor>         </information>          <resources>             <!-- Application Resources -->             <j2se version="1.5+" />             <jar href="test.jar" main="true" />                     </resources>         <security>             <all-permissions/>         </security>         <applet-desc               name="Test Applet"              main-class="com.test.TestApplet.class"              width="100"              height="30">              <param name="testStr" value="something" />         </applet-desc>         <update check="background"/>     </jnlp> 

I want to set testStr value dynamically.

1 Answers

Answers 1

You cant get Request object in jnlp file directly, So as an alternate make jnlp as a jsp page and pass the request and response to it as shown in here - and change the content type to application/x-java-jnlp-file as they did.

one more link http://portal.krypthonas.de/2010/10/11/passing-dynamically-parameters-to-a-java-web-start-app-jnlp/ with complete code snippets.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment