Click to See Complete Forum and Search --> : New at Java


Triple__J
04-10-2002, 04:46 PM
Is there a way that I can get this to show up on a web page? The File that is writen

import java.io.*;

public class Copy {
public static void main(String[] args) throws IOException {
File inputFile = new File("any.txt");
File outputFile = new File("new.txt");

FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;

while ((c = in.read()) != -1)
out.write(c);

in.close();
out.close();
}
}
You need a any.txt
Thanks if you have any ideas that would be cool
:cool:

bryce777
04-10-2002, 05:46 PM
Originally posted by Triple__J
Is there a way that I can get this to show up on a web page? The File that is writen

import java.io.*;

public class Copy {
public static void main(String[] args) throws IOException {
File inputFile = new File("any.txt");
File outputFile = new File("new.txt");

FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;

while ((c = in.read()) != -1)
out.write(c);

in.close();
out.close();
}
}
You need a any.txt
Thanks if you have any ideas that would be cool
:cool:

The code itelf is pretty simple, but you will have to do some setup. You need to set up a web server and a servlet engine. From there, you can create a jsp and do very similar code to show the page.

Do a search on the resin servlet engine/server and they should have some examples of the basic syntax and procedure.

mefisto3
04-10-2002, 09:08 PM
or you can use tomcat servlet engine/web server. it is pretty easy to set up. you can find it in www.apache.org under jakarta tomcat.

also, what IDE are u using (if any). i know that JBuilder has integrated tomcat, so it would be extremely easy to create servlets without any set up at all.