1

I need a help. may be very noob question for experienced programmer. :) I have a entity like this...

@Entity
public class Country {

    @Id
    @GeneratedValue
    private Integer id;

    private String name;
    getters and setters...
}

and a jsp form like this

<form>
    Enter your country name:<input type="text" name="myCountryName" /><br>
    Enter your friend county name: <input type="text" name="frndCountryName"/>
    <input type="submit" value="submit"/>
</form>

(input name is dummy ) (actually this input fields will be created dynamically and the name also will be dynamic. So i don't know , how many input box will be there. ) Now how can i save this two country name in one domain with two different column in database with two different id? Please help if you can. Thanks in advance.

Amir Hossain
  • 184
  • 11
  • How are you trying to save it now? Are you using some controller? You can get POST data from form using `@RequestParam` and manually create and fill two entities. – kurochenko Feb 04 '15 at 13:46
  • actually this input fields will be created dynamically and the name also will be dynamic. So i don't know , how many input box will be there. Is it possible to solve this with @RequestParam ?? – Amir Hossain Feb 04 '15 at 13:55
  • 1
    You may be interested in answer to this question http://stackoverflow.com/a/5624006/816456 – kurochenko Feb 04 '15 at 14:35

0 Answers0