Indeed org.apache.struts2.views.util.TextUtil
was removed from Struts 2 after 2.1.6. You have a few options.
First, as Jaiwo99 indicated, Struts 2 is licensed under the Apache License v2, so you can just take a copy of the source for TextUtil from Struts 2.1.6 and put it in your application. The class has no dependencies on other code, so it should work fine.
Second, you could look at using StringEscapeUtils
from Apache Commons Lang 3, which is now used by Struts2 for escaping HTML and JavaScript. Specifically, look at StringEscapeUtils.escapeHtml4()
method.