Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic url and caching

843802Apr 22 2007 — edited Apr 10 2008
I'm using JRE 1.6.0_01. I have an applet that I am web starting. I passed a user and password to a servlet and it returned the JNLP.

http://domain.com/servlet/MyServlet?u=user&p=password

The problem with this was that the web start application was not cached (did not show up in the cache viewer under application). So it downloaded the jar each time I ran it from the desktop icon.

Next I tried http://domain.com/servlet/MyServlet/user/password and used getPathInfo() to get the query string. This still was not cached and also the jnlp resource was listed against the name 'password'.

Finally I tried http://domain.com/servlet/MyServlet/user/password/somename.jnlp. This worked as I wished. The application was cached and listed in the java cache viewer. The servlet's getPathInfo could check the user/passord (and ignore 'somename.jnlp').

The jnlp looks like -
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.5+" codebase="http://domain.com/servlets/MyServlet/user/password/" href="somename.jnlp">
<information>
<title>a title</title>
  <vendor>Me</vendor>
  <homepage href="http://domain.com/" />
  <description>...............</description>
  <description kind="short">.............</description>
  <description kind="tooltip">.............</description>
  <icon href="http://domain.com/folder/ppicon.gif" width="60" height="60" />
  <icon href="http://domain.com/folder/ppicon.gif" kind="splash" />
  <offline-allowed/>
  <shortcut online="true">
    <desktop/>
    <menu submenu="BLA"/>
  </shortcut>
</information>
<security>
  <all-permissions />
</security>
<resources>
  <j2se version="1.6.0_01" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.6.0"    href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.6+"     href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0_11" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0_10" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0_09" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0_08" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0_07" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0_06" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0_05" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0_04" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0_03" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0_02" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5.0"    href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <j2se version="1.5+"     href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m" />
  <jar href="http://domain.com/folder/sOzePhoto.jar"  download="eager"/>
</resources>
<applet-desc
    name="somename"
    main-class="theclass"
    width="700"
    height="600">
  <param name="aname" value="a value" />
  </applet-desc>
</jnlp>
Hope this helps someone.

Bill
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 8 2008
Added on Apr 22 2007
1 comment
195 views