If you have in your path the library org.apache.commons.lang3
you could use it as next
${T(org.apache.commons.lang3.StringUtils).isNumeric(dataField)}
So in case you want to use an if block it would be:
<th:block th:if="${T(org.apache.commons.lang3.StringUtils).isNumeric(dataField)}">
<p>Is numeric!</p>
</th:block/>
Otherwise, if you don't have org.apache.commons.lang3
in your classpath you could implement your own method which checks if it is numeric and then use it.
So you could create a class like next:
package your.package;
public class Utils {
public static boolean isNumeric(String data){
//impl
return true;
}
}
And then use it the next expression:
${T(your.package.Utils).isNumeric(dataField)}