properties and servlets
[nobr]Hi,
I am new to Servlet programming. A part of my code is as follows which I am placing in doPost method:
out.println("<form method=\"post\" action=\"");
out.println(this.getClass().getName() +"\">");
out.println("URL:<br>");
out.println("<input type=text name=URL>");
out.println("<br>");
out.println("<br>");
When the user enters the URL in the browser I want to store it in the properties file. How can I do this ?
A tutorial on these would be great .
thanks[/nobr]
[723 byte] By [
@debuga] at [2007-11-26 21:52:17]

# 4
thanks for the reply,
sorry for the wrong information, I am a complete noob,
my mistake. I want to save data permanently to a properties file stored on my computer so that when the user opens the browser he looks to all the data he has entered.
the problem is my servlet always throws a filenotfound exception. I am using tomcat. how do we specify file path in servlet programming
FileOutputStream outp=new FileOutputStream("C:\\pp\\data.properties");
properties.store(outp, "Data Test");
Some hints would be great.
regards,
@debug
# 5
> FileOutputStream outp=new
> w FileOutputStream("C:\\pp\\data.properties");
>
> properties.store(outp, "Data Test");
>
>
This seems right to me.
MeTitus
# 6
> my mistake. I want to save data permanently to a
> properties file stored on my computer so that when
> the user opens the browser he looks to all the data
> he has entered.
When you say "my computer" do you mean the server where the servlet is running? As opposed to the client computer where the user's browser is sending requests from?