Jsp - arraylist
Hi,
I have a page where I can add properites to a project and when i write in some textfields and then click more properties I don't want what I just wrote to be written to the database I wan't it saved in an arraylist until I click save and then all properties from the arraylist will be saved to database. If I leave the page without saving and go to another project I wan't the arraylist to be empty but I don't wan't to create an arraylist for each project and have in memory. The first page where I start is a projectpage and if I click on a project I go to it and can add properties like a shoppingcart but if I go back it has to be cleared and not saved for the hole session.
I solved it by making a static arraylist in my javabean where I have created getters and setters for my variables and then making a method that will save the variables in the arraylist. If i go back to the first page without saving I call a method in the bean that clears the arraylist. I tried with different scopes like page, request and so on but none of them seems to what I want. If I don't make the arraylist static it won't be saved when I click add more properties.
What I basically wan't to do is create a shoppingcart for one page and if I leave without saving it will be cleared.
I don't know if anyone understands what I'm trying to do and if anyone does can you tell me if this is the best way or if there is any alternatives.
/Johan

