That's not possible with standard JSTL tags nor with the standard NumberFormat
API which it is using under the covers. You'd need to create a custom JSP tag or EL function for that. You could achieve the job with simple String
manipulation methods or even (ab)use Swing's MaskFormatter
:
String cnpj = "12345678000199";
MaskFormatter mf = new MaskFormatter("##.###.###/####-##");
mf.setValueContainsLiteralCharacters(false);
System.out.println(mf.valueToString(cnpj)); // 12.345.678/0001-99
With an EL function you can ultimately end up like this:
<c:out value="${util:formatCnpj(user.cnpj)}" />
For more detail on creating an EL function, see also the bottom of Hidden features of JSP/Servlet.