Skip to main content

jnlp pain

6 replies [Last post]
fatbatman
Offline
Joined: 2004-12-24
Points: 0

I thought it was time to make use of jnlp files in conjunction with the applet tag on update 11, primarily for the auto shortcut install features, but I'm having a few problems.

The applet in question can be viewed at http://socialbang.com/games/Theclub/chat-room-popup.jsp it runs but there a few things not quite right

1. I added;
params["jnlp_href"] = "club-applet.jnlp";

to the params that is then launched from;
deployJava.runApplet(attributes, params, minJavaVer);

but this results in two virtual machines being created which results in a slower start up time, how can I avoid this?

2. My jnlp file contains;

But shortcuts are not installed, why?

Regards

James

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fatbatman
Offline
Joined: 2004-12-24
Points: 0

Sorry - go to that page, then do a Ctrl+refresh and it should be ok.

(Normally the applet is only viewable within a frameset @ http://socialbang.com/go but I posted the link to the specific page so it would be easier for you to see applet script + jnlp but the page was only viewable after visiting the holding page, or a refresh).

http://socialbang.com/games/Theclub/club-applet.jnlp




Socialbang
Joyplay Ltd









width="800"

height="800">


from chat-rooms-popup.jsp

....
var attributes = new Array();
attributes["id"] = "appletComponent";
attributes["style"] = "width:1px;height:1px";
attributes["mayscript"] = "true";
var params = new Array();
params["jnlp_href"] = "club-applet.jnlp";
params["draggable"] = "true";
params["type"] = "application/x-java-applet;version=1.6";
//params["code"] = "com.joyplay.client.theclub.ChatRooms.class";
params["codebase"] = ".";
//params["archive"] = "<%=jars%>";
params["name"] = "SocialBang";
params["scriptable"] = "false";
params["server"] = "<%= gamemovie.getActiveJadeserversAsString()%>";
params["port"] = "8888";
params["domain"] = "<%=tWebsiteName %>";
params["username"] = "<%= tUsername %>";
params["key"] = "<%= tKey %>";
params["game"] = "<%= gamemovie.getGame().getName()%>";
params["movie"] = "<%= gamemovie.getName()%>";
params["notes"] = "<%= gamemovie.getNotes()%>";
//params["clientClass"] = "<%= gamemovie.getGame().getClientclass() %>";
params["room"] = "<%= room %>"; //go to room
params["usrid"] = "<%= usrid %>"; //go to user
params["gametype"] = "<%= gametype %>"; //go to user
params["view"] = "<%= viewProfileForUsrId %>"; //view user profile
params["language"] = "${language}";
params["fromBrowser"] = "true";
params["autosendconsole"] = "false";

<%-- Run the java applet, installing Java if need be --%>
//deployJava.runApplet(attributes, params, minJavaVer);

if(!deployJava.versionCheck(minJavaVersion)){
showLoadingJavaScreen();
setTimeout("installJava();",1000); //A slight delay so users can read that we're about to install Java
}else{
//The user should already here java this point
showAppletLoadingScreen();
deployJava.runApplet(attributes, params, minJavaVer);
timerId = setTimeout("hideLoadingPanel();",5000); //This should be called from the applet but it seems sometimes this doesn't happen
}
.....

rogyeu
Offline
Joined: 2006-07-30
Points: 0

I think you need the href and codebase attributes in your JNLP tag. Without that, Java Webstart has no reference to the JNLP file and where to look for when re-launched, in this case, from a short-cut.

-- RY

fatbatman
Offline
Joined: 2004-12-24
Points: 0

Thanks, that fixed it.

I wonder if it would be better if the codebase and href were set automatically if blank?

Still not sure I see the logic in creating shortcuts for webstart applications but not for applets unless they've been "dragged".

Anyway I'm going to play around some more and give it more thought when I have some more time then post back

cheers

James

rogyeu
Offline
Joined: 2006-07-30
Points: 0

I cannot access the URL you've provided. The server seems to be down since 10am PT when I tried.

For 2, did you drag the Applet out? If not, a short-cut won't be created. It does not make sense for users to have shortcuts created for every Applets they have used unless they drag them out.

fatbatman
Offline
Joined: 2004-12-24
Points: 0

Not sure what happen to the server, it was ok for me just then, but we've recently moved to a new hosting provider...

Yes I did try dragging it out(alt+click+drag), then closing the browser etc also but nothing...

..but, I do actually want it to be installed without them having to do this, I disagree that it only makes sense for the install to be done after the drag as it just means we'll have to create an elaborate process, to get them to do this, rather than just a button or better still automatically. This facility is available with webstart so why not applets?
This doesn't mean this will be the case for every applet just those that specify so and they'll still have to agree to it.

Anyway for now, it doesn't install even after dragging, any ideas?

rogyeu
Offline
Joined: 2006-07-30
Points: 0

I still can't access the Applet from your URL. Can you post the JNLP file, and the Applet tags including any params / attributes you used.

Thanks,
RY