Hi, Topiccategories list retrives data but I have made small test and wanted to save simple test data. Below is the code. Unfirtunately when I open checkboxprop.properties I can't see any data. Maybe property file must be located in any special place in project. I don't know. Can you help. Regards, Rafal
try
{
FileOutputStream fos =
null
;
properties.store((fos =
new FileOutputStream("checkboxprop.properties")), "Author: jasonX"
);
fos.close(); System.
out.println("Data are saved"
);
}
catch
(IOException e) {
System.
out.println("Error"
);
Dnia 14-02-2011 o godz. 19:20 Chil-Hoan Kwon napisał(a):
> Compule and Run without "properties.setProperty("idRegion",
> topicCategories);" code and check check "checkboxprop.properties" file
> to see the saved data?
> If not, check data of topicCategories. Is there any retrieved data on
> topicCategories?
> Any how, use this
> http://download.oracle.com/javase/tutorial/essential/environment/properties.html
> for your reference site.
>
> Chil
>
> --- On Tue, 2/15/11, Rafał Laczek <rafal_lac...@wp.pl> wrote:
>
> > From: Rafał Laczek <rafal_lac...@wp.pl>
> > Subject: [java ee programming] Property file
> > To: "Java EE (J2EE) Programming with Passion!"
> <java-ee-j2ee-programming-with-passion@googlegroups.com>
> > Received: Tuesday, February 15, 2011, 1:46 AM
> > Hi,
> >
> > In my project I will have no database and that's why all
> > selected
> > results in checkbox I decided to store in property file.
> > All these results I catch into topicCategories
> > list(String).
> > Now I want to save results in property file.
> > Is any possibility to save this list in my property file?
> > Below I send my code.
> > I'm searching in internet but I can t find solution.
> >
> > Thanks and regards,
> > Rafal
> >
> > Properties properties = new Properties();
> > Â //Extracting data from the checkbox field
> > Â Â String select[] =
> > request.getParameterValues("id");
> > Â Â Â if (select != null &&
> > select.length != 0) {
> > Â Â Â for (int i = 0; i < select.length;
> > i++) {
> > Â Â Â
> > Â Â Â Â Â topicCategories.add(select[i]);
> > Â Â Â }
> > Â Â Â }
> > Â Â Â // Write properties file.
> > Â Â Â Â Â try {
> > properties.store(new
> > FileOutputStream("checkboxprop.properties"), null);
> > Â Â Â Â Â
> > properties.setProperty("idRegion", topicCategories);
> > Â Â Â Â Â } catch (IOException e) {
> > Â Â Â Â Â }
> >
> >
> > --
> > You received this message because you are subscribed to the
> > Groups "Java EE (J2EE) Programming with Passion!" group.
> > To post to this group, send email to
> > java-ee-j2ee-programming-with-passion@googlegroups.com
> > To unsubscribe from this group, send email to
> > java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
> >
--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en