First of all, the key sentence:
$(".js-example-tags").select2({
tags: true
})
Don't underestimate that this code is powerful. Add class directly where needed, as shown in the following code:
<div class="form-group required">
<label class="control-label col-sm-4">Test select2: </label>
<div class="col-sm-8">
<form:select path="sett"
class="form-control required js-example-tags"
οnchange="onchange('${}','${}');">
<form:option value='' label='Please select' />"
<form:options items="${fns:findSettList()}"
itemLabel="label" itemValue="value" htmlEscape="false" />
</form:select>
</div>
</div>
Note that there is an onchange method above to
$(".js-example-tags").select2({
tags: true
})
Add to this method. Otherwise it will not be possible.