P
Paul Lutus
Aviv said:Hello,
I am trying to use the following code to write my data to my applet's home
URL on my server:
Don't multi-post.
Aviv said:Hello,
I am trying to use the following code to write my data to my applet's home
URL on my server:
Aviv Gurwitz said:Hello,
I am trying to use the following code to write my data to my applet's home
URL on my server:
try
{
URL colorsURL = new URL(getCodeBase() + "data/colors.dat");
URLConnection colorsConnection = colorsURL.openConnection();
colorsConnection.setDoOutput(true);
ObjectOutputStream colorsStream = new
ObjectOutputStream(colorsConnection.getOutputStream());
colorsStream.writeObject(jBoard.getColors());
colorsStream.flush();
colorsStream.close();
}
catch (MalformedURLException mue)
{
System.out.println(mue.getMessage());
}
catch (IOException ie)
{
System.out.println(ie.getMessage());
}
The code compiles properly and does not generate any runtime error or caught
exception error message in the Sun Java Console window (when run on my
server).
When run on my local computer I get the caught runtime error message:
"protocol doesn't support output". Here I'm not surprised.
But why does the code run well on the server and yet there is no colors.dat
file to be found in the data directory on the server?
[...]Aviv Gurwitz said:Hello,
I am trying to use the following code to write my data to my applet's home
URL on my server:
try
{
URL colorsURL = new URL(getCodeBase() + "data/colors.dat");
URLConnection colorsConnection = colorsURL.openConnection();
colorsConnection.setDoOutput(true);
ObjectOutputStream colorsStream = new
ObjectOutputStream(colorsConnection.getOutputStream());
colorsStream.writeObject(jBoard.getColors());
colorsStream.flush();
colorsStream.close();
}
When run on my local computer I get the caught runtime error message:
"protocol doesn't support output". Here I'm not surprised.
But why does the code run well on the server and yet there is no colors.dat
file to be found in the data directory on the server?
Aviv said:Hi again,
I managed to find an article on writing to files and I copied and ran from
it the following code:
I placed the cgi script in a cgi-bin folder in my home directory under my
html directory and my applets directory. Yet when I run the applet it runs
smoothly with no exceptions and yet there is no file to be found in the
cgi-bin directory...
What am I doing wrong?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.