0
I am developing a web application, with java spring mvc, and need to list items in a dynamic checkboxList and include a select option in each item.
Something that in html would be similar to the code below:
<ul>
<li>
<input type="checkbox"> Item 1 -
<select>
<option value="1">Ativo</option>
<option value="2">Inativo</option>
<option value="3">Bloqueado</option>
</select>
</li>
<li>
<input type="checkbox"> Item 2 -
<select>
<option value="1">Ativo</option>
<option value="2">Inativo</option>
<option value="3">Bloqueado</option>
</select>
</li>
<li>
<input type="checkbox"> Item 3 -
<select>
<option value="1">Ativo</option>
<option value="2">Inativo</option>
<option value="3">Bloqueado</option>
</select>
</li>
</ul>
How can I do this dynamically in jsp? Remembering that the checkbox items come from the database.
Man, thank you, your answer helps and solves quickly, but if we follow good practices, it’s not very nice to put java code in the jsp, let alone invoke a DAO class. But as I’m kind of starting in the jsp, knowing this feature is already a big help.
– Erico Souza