Take the 2-minute tour ×

My project was using older versions of Struts2 (2.0.x) Now we are planning to upgrade Struts2 version which has some improvements and bug fixes.

I updated the pom.xml as per that. However I found out that in my old strtus2-core lib, there's


But in latest version it's not there and I am facing compilation errors.

Any idea why it's missing or how do i get it?

share|improve this question
This class has been deleted from Struts2. Are you using it in you code? –  Aleksandr M Nov 26 '12 at 12:01
Yes. That's the reason I am getting erros :) –  Reddy Nov 26 '12 at 14:22

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer

Could it be this one?

share|improve this answer
I am not sure. But we are using from Struts2. How do I replace the same. Because it's bit legacy application. Should be handled carefully :) –  Reddy Nov 26 '12 at 14:23
@NitinGurram xworks2 is part of struts2! and the class is just moved from struts2-core to xworks, it is no problem at all –  Jaiwo99 Nov 26 '12 at 15:14
@NitinGurram please check xwork-core-x.x.x.jar, in the package META-INF, you can find the license, which is Apache License v2 –  Jaiwo99 Nov 26 '12 at 15:45
TextParseUtil (not TextParserUtil) is not the same class. –  Steven Benitez Nov 26 '12 at 19:21

Your Answer


