mardi 13 septembre 2016

Show on JSF page only certain fields of the DTO based on annotation

Consider a problem.

I have many DTOs with some fields and i need to make a bunch of JSF pages which have to show data from the DTOs' fields and label for that field. Some of the fields should not be shown on the page. Hardcoding every field on the page and making a different ViewBean for that page seems to be tedious.

There is an idea that it is possible to annotate fields of the DTO with custom annotation that has field 'Label' and then show only those fields on the page which can help to avoid making different xhtml pages.

Can someone explain is it possible to show POJO on JSF page only with annotated fields and corresponding label? So far, I didn't find any examples.

Than you very much:)





Aucun commentaire:

Enregistrer un commentaire