Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JEP java location



Can you require 1.5?

On Aug 16, 2006, at 2:04 PM, Bill Janssen wrote:

I suppose I can (currently, we allow 1.4.2, since that's the default
on vanilla Tiger), but that doesn't help.  Still broken there.  My
current work-around is to tell people to use Safari instead of Camino
or Firefox.

OK, I turned the sample code I posted the url for earlier into a applet, the Fetch class part of it, the url again,


http://java.sun.com/developer/JDCTechTips/2005/tt0913.html

The turned applet class...

import java.io.*;
import java.net.*;
import java.util.*;
import java.applet.Applet;

public class Fetch extends Applet implements Runnable {
String server = "http://www.kikobu.com/appletsession/";;
Thread mainThread;

public void init() {
	String server = getParameter("server");
	if (server != null) this.server = server;
    mainThread = new Thread(this);
    mainThread.start();
}
public void run() {
   try {
	   String urlString = server;
	   CookieHandler.setDefault(new ListCookieHandler());
	   URL url = new URL(urlString);
	   URLConnection connection = url.openConnection();
	   Object obj = connection.getContent();
	   url = new URL(urlString);
	   connection = url.openConnection();
	   obj = connection.getContent();
	   connection = url.openConnection();
	   obj = connection.getContent();
   }
   catch (Exception ex) { ex.printStackTrace(); }
}
}

Note that all the applet class does for cookies is...
CookieHandler.setDefault(new ListCookieHandler());
and I added one extra connection for good measure if you look at the tech tip.
Signed the jar for the applet to set the CookieHandler and when it runs from Firefox against what was indicated before was, and in fact seemed to be, a problematic URL for Firefox applet session id's ...


Wed Aug 16 15:46:06 CDT 2006 JEP creating applet Fetch (file:/Users/ mjh/Sites/)
Cookies: {Connection=[keep-alive], Host=[www.kikobu.com], User-Agent= [Mozilla/4.0 (Mac OS X 10.4.7) Java/1.5.0_06], GET /appletsession/ HTTP/1.1=[null], Content-type=[application/x-www-form-urlencoded], Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2]}
Cache: []
Adding to cache: JSESSIONID=29B76DDC581B711B8C09A97DBDEA1691
Cookies: {Connection=[keep-alive], Host=[www.kikobu.com], User-Agent= [Mozilla/4.0 (Mac OS X 10.4.7) Java/1.5.0_06], Cookie= [JSESSIONID=29B76DDC581B711B8C09A97DBDEA1691], GET /appletsession/ HTTP/1.1=[null], Content-type=[application/x-www-form-urlencoded], Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2]}
Cache: [JSESSIONID=29B76DDC581B711B8C09A97DBDEA1691]
Cookies: {Connection=[keep-alive], Host=[www.kikobu.com], User-Agent= [Mozilla/4.0 (Mac OS X 10.4.7) Java/1.5.0_06], Cookie= [JSESSIONID=29B76DDC581B711B8C09A97DBDEA1691], GET /appletsession/ HTTP/1.1=[null], Content-type=[application/x-www-form-urlencoded], Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2]}
Cache: [JSESSIONID=29B76DDC581B711B8C09A97DBDEA1691]


The session id appears to be maintained with no effort on the applets part. I have no idea if HTTPS throws in any wrinkles but it seems otherwise if you can require 1.5 this should be a non-issue. 1.6 supposedly actually provides a default cookie handler so life gets even better.

Back to JEP, still curious if I can manage that w/o 1.5.


Mike Hall mikehall at spacestar dot net http://www.spacestar.net/users/mikehall http://sourceforge.net/projects/macnative



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: JEP java location (From: Bill Janssen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.