Getting the modal hints for the column in class
We will update the maxlength for the column in portlet-modal-hints.xml. Just like as below <field name="comments" type="String"> <hint name="max-length">500</hint> </field> If we want to get these max length in the class, we can use the below code. ModelHintsUtil.getMaxLength(model, field) model : Class name field : columnName ex: ModelHintsUtil.getMaxLength(KBUser.class.getName(), "comments");