File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
build/classes/com/udemy/spring/form
src/com/udemy/spring/form Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 17
17
<br >
18
18
<form:select path =" country" >
19
19
20
- <form:option value =" india" label =" India" />
21
- <form:option value =" australia" label =" Australia" />
22
- <form:option value =" england" label =" England" />
20
+ <form:option value =" india" label =" India JSP" />
21
+ <form:option value =" australia" label =" Australia JSP" />
22
+ <form:option value =" england" label =" England JSP" />
23
+ <form:options items =" ${ student. countryOptions } " />
23
24
24
25
</form:select >
25
26
Original file line number Diff line number Diff line change 1
1
package com .udemy .spring .form ;
2
2
3
+ import java .util .LinkedHashMap ;
4
+
3
5
public class Student {
4
6
5
7
public String firstname ;
6
8
public String lastname ;
7
9
public String country ;
10
+
11
+ public LinkedHashMap <String ,String > countryOptions ;
12
+
8
13
public Student ()
9
14
{
15
+ countryOptions =new LinkedHashMap <>();
10
16
17
+ countryOptions .put ("IN" ,"India Map" );
18
+ countryOptions .put ("Aus" ,"Australia Map" );
19
+ countryOptions .put ("Eng" ,"England Map" );
11
20
}
12
21
13
22
public String getCountry () {
14
23
return country ;
15
24
}
16
25
17
26
public void setCountry (String country ) {
18
- country = country ;
27
+ this . country = country ;
19
28
}
20
29
21
30
public String getFirstname () {
22
31
return firstname ;
23
32
}
24
33
34
+ public LinkedHashMap <String , String > getCountryOptions () {
35
+ return countryOptions ;
36
+ }
37
+
38
+ public void setCountryOptions (LinkedHashMap <String , String > countryOptions ) {
39
+ this .countryOptions = countryOptions ;
40
+ }
41
+
25
42
public void setFirstname (String firstname ) {
26
43
this .firstname = firstname ;
27
44
}
You can’t perform that action at this time.
0 commit comments