I need to populate a drop down with all the values within a list of strings.
Controller Class
@RequestMapping(value = \"/generateIds\", method = Requ
This is how I populate the drop down list.I think it may help to you get some idea about it.
Controller
List operators = operatorService.getAllOperaors()
model.addAttribute("operators", operators);
Model
@Entity
@Table(name = "operator")
public class Operator {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
@JsonIgnore
private Long id;
@NotBlank(message="operator Name cannot be empty")
@Column(name = "operator_name", nullable = false)
private String operatorName;
getters and setters ...
}
View