Iv'e got this error message : "protocol doesn't support output"

When i execute my applet the part of code below give's me thi error message: "protocol doesn't support output". This part of the code save's a vector(of string) into a data file. I'm able to load the file but i can't put info in it. Helppppppppp:
That's the method where tje problem is :
private void saveVector()
Evenement Ev;
try{
// THE ERROR IS PROBABLY IN THE 2 NEXT LINES!
Dos = new DataOutputStream(new BufferedOutputStream( new URL(this.getCodeBase(), FichierEvenement).openConnection().getOutputStream()));
for ( int i = 0; i <= VecEvenement.size();i++ )
Ev = (Evenement) VecEvenement.elementAt(i);
String Ligne = Ev.getDateEvent().trim().concat("|")+ Ev.getTitre().trim().concat("|") + Ev.getLieu().trim().concat("|") + Ev.getDesc().trim().concat("|") + Ev.getPers().trim().concat("|")+ Ev.getAdresse().trim().concat("|");
Dos.writeUTF(Ligne);
Dos.close();
catch (Exception e) {
LErr.setText(e.getMessage());
}

http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html
As is noted in this part of the tutorial, a URL may simply not support output:
"Next, the program creates the URL object--the URL for the backwards script on java.sun.com--opens a URLConnection, and sets the connection so that it can write to it:
URL url = new URL("http://java.sun.com/cgi-bin/backwards");
URLConnection c = url.openConnection();
c.setDoOutput(true);
The program then creates an output stream on the connection and opens a PrintWriter on it:
PrintWriter out = new PrintWriter(c.getOutputStream());
If the URL does not support output, getOutputStream method throws an UnknownServiceException. If the URL does support output, then this method returns an output stream that is connected to the standard input stream of the URL on the server side--the client's output is the server's input. "
Sorry I can't be of more help.

Similar Messages

Maybe you are looking for