java - Read property of annotation -
if had defined class:
@mainform(grupo = 3, icone = "user") public class usuario { ... }
and pass view list (which include class above):
public list<class<?>> lista_classes_projeto() { ... }
is there way read value icone
in jsp code:
<c:foreach var="option" items="${lista}"> <li> <c:url value="/${option.simplename}/listagem" var="url"/> <a class="link" href="${url}"> <i class="icon-"></i> <span>${option.simplename}</span> </a> </li> </c:foreach>
i didn't test, give line try: (in each)
((mainform) option.getannotation(mainform.class)).icone();
note null handling ignored. assume option (class)
has annotation @mainform
Comments
Post a Comment