Luca Bracci

Greenhorn
+ Follow
since Oct 07, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Luca Bracci

Oh nevermind!!
I got it working
I as just looking for it in the wrong place, the file actually is being saved in the bin folder ,,, oh I learned somethign new today.... snap I am one slow and dumb person....
22 years ago
Hi guys, obviously I am pretty new in servlets and I have a serious problem.
I want to write the data retrieved from the user to a txt file.
That's sounds easy right but I have been trying this for the past 4 hours , infact I cant even write anythign to a file thru the servlet please help ...
It works fine in a main method of a decent class when I run it but it just doesnt write to the file when I run the servlet...
here is the doGet() method :


public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
try
{
BufferedWriter pw = new BufferedWriter(new FileWriter("memberfile.txt", true));
pw.write("Please work!!");
pw.newLine();
System.out.println("Why isn't it working?");
pw.close();
}
catch(IOException ioe)
{
System.out.println("IOException thrown in writeMember() method");
}

}


Why isn't it writing to the file? is there anything I dont know? ... please help and thanks
22 years ago
oh man this is sad and embarassing ....
I still can't get it to work, I tried everything you guys suggested , I am really discouraged now...
1 last try perhaps ...
Ok here :
My jdk directory ----- c:/jdk1.3/bin
my tomcat directory ----- c:/tomcat
servlet.jar ---- c:/tomcat/servlet.jar
my JAVA_HOME ----- c:/jdk1.3/bin
my TOMCAT_HOME ----- c:/tomcat
Tomcat is running fine , everythign is fine BUT I cant compile my first servlet ... the compiler gives me an error on the import statement indicating javax.servlet not found...
What do I do?
thanks for bearing with my dumbness...
Now what do I do ?? ;( ;( ;( ...
this is the batch file i created for it :
set path =c:/jdk1.3/bin
set path =c:/tomcat/lib/servlet.jar
which is not working ...
22 years ago
Yes I did
java_home is pointing to the jdk/bin and tomcat one is pointing to the tomcat root folder,,, the problem is not in running of tomcat its that I cant get my class path to working , I cannot include javax.servlet ...
my servlet.jar is in tomcat/lib/servlet.jar
what whould be my class path?
22 years ago
I am really having problem compiling my first servlet...
My tomcat is running but when I compile the servlet it says that javax,.servlet not found plz help
thanks
22 years ago

Originally posted by Pranit Saha:
Do u have the jsdk2.0 or later installed.. first u have to install it and then write down the classpath in autoexec.bat file..
set classpath = %CLASSPATH%;c:\JSDK2.0\lib\jsdk.jar;
assuming that it's installed in c:\
Hope it will work..
Pranit
it gives me errors saying that javax.servlet not found and stuff ,



wait you are saying servlet.jar ain't it???
I have to get jsdk?
oh man this is so confusing ..
22 years ago
Ok I am also having a cache problem ... on this site and everywhere ,, I cant even see my own posts after i post them .. please helpe!
22 years ago
Guys can someone also please help me on the classpath thingy... I got the tomcat running and everythign but cant use the servlet api , it gives me errors saying that javax.servlet not found and stuff , I even created a path pointed it to the proper directory for the servlet.jar file but still no luck...
22 years ago