Hi Guys.
For my web application i am offering an administrative page that allows a user configure their website.
This type of configuration could be seen in property files but i am storing the information in a database.
My DB Table has a table StoreConfig that contains, id,key,value
Sample data:
1,STORE_NAME,My Store
2,STORE_EMAIL, email@email.com
I have mapped this table via hibernate to a StoreConfig object that has, id,key,value.
On my StoreConfiguration page, i want to display a form that contains many of these config items e.g 10 items.
Originally i was going to create a custom model object that would have g(s)etters such as storeName,storeEmail etc and then in my service layer
i would mapp this model to a many store config objects.
But then i was wondering if i could just use a list of StoreConfig objects in my original web form.
maybe use someting like
When the user fills out the form and submit my controller would collect a list of storeConfig items loop thru them and save them.Code:<form action="storeConfig.html"/> ------ 1st Item is Store Name -------- <input type ="hidden" name="storeConfig[0].key" value ="STORE_NAME"/> <input type ="text" name="storeConfig[0].value" value =""/> ------ 2st Item is Store Email -------- <input type ="hidden" name="storeConfig[1].key" value ="STORE_EMAIL"/> <input type ="text" name="storeConfig[1].value" value =""/> </form>
I putting this out there, to see if this is possible of if anyone could suggest abetter way of doing this.
Cheers


Reply With Quote
