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 > 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 > -- 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