commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kedar Panse" <ke...@bancbridge.com>
Subject RE: HttpClient : Sending Multipart request from applet
Date Mon, 19 Jun 2006 11:30:19 GMT
OutputStream oc = new FileOutputStream("c:/shiv/filewrite.txt"); 
You may need to add this file in to acl for reading

http://java.sun.com/sfaq/#read




Kedar

-----Original Message-----
From: shiv shankar [mailto:shiva_ibm@yahoo.com] 
Sent: Monday, June 19, 2006 3:57 PM
To: commons-user@jakarta.apache.org
Subject: HttpClient : Sending Multipart request from applet

Hello all,


I need help on the httpclient . I have used this api in a JFrame and sending
mutipart request to servlet, which is doing a fine job of uploading the the
file.


But when the same is done using applet, it is gving me


java.Security.AccessConlroleException.

The problem come when it process a statement 

PostMethod pMethod = new PostMethod(url);

The following is a small program.Which I tred to execute and giving me
lava.security.AccesscontroleException EVEN AFTER SIGNING THE APPLET



import java.io.*;
import java.awt.*;
import java.applet.*;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import
org.apache.commons.httpclient.methods.PostMethod;
import
org.apache.commons.httpclient.methods.multipart.FilePart;
import
org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
import
org.apache.commons.httpclient.methods.multipart.Part;
import
org.apache.commons.httpclient.params.HttpMethodParams;


public class FileStreamApplet extends Applet {

	public void init() {

		try {

			 String targetURL =
"http://localhost:8080/echo/echo";
			 	PostMethod filePost = new
PostMethod(targetURL);


			System.out.println("Hello from FileStream Applet");
			Label l1 = new Label("Write into file using
applet");
			this.add(l1);
			OutputStream oc = new
FileOutputStream("c:/shiv/filewrite.txt");
			oc.write("Welcome to eriting a applet".getBytes());
			oc.close();
			Label l = new Label("Write into file using applet");
			this.add(l);


		}
		catch(Exception e) {
			e.printStackTrace();
		}

	}
}






__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message