Item2490: Java Applet datatransfer to Foswiki (HttpRequest)

pencil
Priority: Normal
Current State: No Action Required
Released In:
Target Release: n/a
Applies To: Extension
Component:
Branches:
Reported By: AlexanderStoffers
Waiting For:
Last Change By: CrawfordCurrie
Hi!

I´m just switching our Wiki from Mediawiki to Foswiki.

We integrated an Java Applet into our Wiki. Between the Applet and the Wiki i have to transfer data in both directions (strings and files). In Mediawiki i realized the transfer from applet to wiki with a http-request. I handled the request with some php code in a "special page". I think in Foswiki i can handle it with a REST-Handler??

Now i would like to integrate our Applet into the Foswiki. I looked for some extensions with the same problem. I found the JHotDraw Plugin but i still wonder if it´s not possible to transfer data with an direct http-request out of the applet? Is it necessary to use this javascript file as an interface?

Here is some Code of our Http-Request:

HttpURLConnection conn = null;
BufferedReader response = null;
try {
        URL url = new URL(getDocumentBase(), uploadURL);
	conn = (HttpURLConnection)url.openConnection();
	ClientHttpRequest request = new ClientHttpRequest(conn);
        request.setParameter("validation_key", validation_key);	
        request.setParameter("topic", "WebHome");
	request.setParameter("filename", "Test123");

..........................................

I always get an java error:

Fehler: uncaught exception: Error calling method on NPObject! [plugin exception: java.security.AccessControlException: access denied (java.util.PropertyPermission http.strictPostRedirect read)].

Is there any tutorial or other help how i can get my files out of the java applet?

Thank you in advance, Alex
See NotesOnJavaApplets, and the Java and Javascript code in JHotDrawPlugin. The javascript is required to support the double-submission validation process, because (as I discovered to my chagrin) Java can't access cookies in the browser domain.

BTW please use the Support web on Foswiki.org for support queries; this is a bug tracker. Thanks.

-- CrawfordCurrie - 12 Dec 2009

ItemTemplate edit

Summary Java Applet datatransfer to Foswiki (HttpRequest)
ReportedBy AlexanderStoffers
Codebase 1.0.8
SVN Range
AppliesTo Extension
Component
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r2 - 12 Dec 2009, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy