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]
# 1
Do you want to use session objects? Is that it?MeTitus
Me_Titusa at 2007-7-10 3:46:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Yes
@debuga at 2007-7-10 3:46:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-Session-Tracking.htmlMeTitus
Me_Titusa at 2007-7-10 3:46:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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

@debuga at 2007-7-10 3:46:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

> FileOutputStream outp=new

> w FileOutputStream("C:\\pp\\data.properties");

>

> properties.store(outp, "Data Test");

>

>

This seems right to me.

MeTitus

Me_Titusa at 2007-7-10 3:46:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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?

DrClapa at 2007-7-10 3:46:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...