Something else Applets can do and Webstart can't

After some extensive testing, I found an issue with Webstart that I can’t understand. If I embed a .php file with stuff from my .jnlp, and put in some stuff in tags which are dependent on the current browser session, I get issues.

Right now I’m passing the user id from my php database to manage game saving. However, when I load the .php (I can do the same thing with a .jnlp file too), Webstart goes and calls the URL to it AGAIN.

This is a problem because webstart isn’t linked to the same session, and therefore it isn’t linked to the cookies either. That means my database doesn’t recognize it from the same session. This is a vital issue because being logged in to my site means you’ll be given the correct user id. Since Webstart’s own little session ISN’T logged in, it’ll get passed a value to say that it is not logged in.

I want Webstart to use the .jnlp or .php I just loaded, and NOT load another one. I know I could do something like give it a URL to a different .jnlp with static data that I generate when the initial .php is called, but that’s really ugly and will result in a lot of unnecessary files created, as well as problems with multiple users trying to use the same computer.

How can I convince Webstart to use what I give it and not grab the .php or .jnlp file again? By the way, SpuTTer tested this idea and said he got the same results so I know it’s not a fluke or me misreading what’s going on :slight_smile:

PS: The rant in the title about Applet’s being able to do this is because you can just add parameters to the Applet calling code very easily, whereas it’s so much more complicated with Webstart to the point where it doesn’t even work, as I’ve illustrated.

My initial thoughts regarding webstart that it was created to replace applets. But know I realise it isn’t. Its a method to depoly applications, they just stuck applets in there for the hell of it too! So I dont think the two are comparable to be honest. I do now like webstart, but applets have their places.

(Mainly to shut blah*3 up about webstarting this and webstarting that ;D)

DP

some of my little Applet games on my site take like 2 seconds to load and 1 minute to play. If they were in Webstart, they’d take that full minute just to load :stuck_out_tongue:

Also to pop up one of those little things in a full window that takes over focus is just overkill I think. Applets certainly have their place

I’m having some difficulty understanding the problem here, so perhaps you could paste some example code (perhaps the php bits?) which would make it more obvious. Usually if an app like webstart is reloading a URL you dont want it to its because of incorrect or naive web caching going on; it may be worth snooping your HTTP protocol packets to see what expiry time they;re setting - it may be that webstart thinks the page has expired and so is (correctly) re-fetching it.

You can read RFC 2616 for fll details on when a URL must be reloaded and when it shouldn’t be based on http headers.

HTH.

The other comments about webstart sound ill-conceived or possibly just trolling so I’ve nothing to say there, other than that if you have a webstart problem that hasn’t already been listed in that thread which gathers webstart problems then you owe it to yourself to post it there!

EDIT: for new readers, the applicability of webstart vs applets, and the extent to which players vote with their feet, has been discussed at length in other threads.


<?php
      // include necessary phpbb code
      define('IN_PHPBB', true);
      $phpbb_root_path = '../forums/';
      include($phpbb_root_path . 'extension.inc');
      include($phpbb_root_path . 'common.'.$phpEx);
      $userdata = session_pagestart($user_ip, 3);
      init_userprefs($userdata);

      header("Content-type: application/x-java-jnlp-file");
      echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>

<jnlp spec="1.0+" codebase="http://www.gamelizard.com/webstart" href="rimscape.php">
 <information>
    <title>Rimscape</title>
    <vendor>GameLizard.com</vendor>
    <homepage href="http://www.gamelizard.com" />
    <description>2D Space Action/RPG game.  Make friends or enemies as you fight to survive and trade for enhancements during your quest to find the long lost world of Earth.</description>
      <icon href="icon.png"/>
      <offline-allowed/>
  </information>
  <security>
  <all-permissions/>
  </security>
  <resources>
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+" inital-heap-size="32m" max-heap-size="256m"/>
    <jar href="rimscape.jar"/>
      <jar href="lib/resources.jar"/>
  </resources>
  <resources os="Windows">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
    <nativelib href="gagetimer-native.jar"/>
  </resources>
  <application-desc main-class="com.gamelizard.games.rimscape.RimscapeRunner"> 
    <argument><?= $userdata['user_id'] ?></argument>
    <argument><?= $_SERVER['SERVER_NAME'] ?></argument>
  </application-desc>
</jnlp>

There’s the code for it. This is in its php form, which actually works for me, but aparantly no one else :slight_smile:

I checked out RFC 2616:http://www.faqs.org/rfcs/rfc2616.htmland 'bout choked on my breakfast to see the length of it. I’ll snoop those protocol packets