문제

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

org.apache.struts2.views.util.TextUtil

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?

도움이 되었습니까?

해결책

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.

다른 팁

Could it be this one?

com.opensymphony.xwork2.util.TextParserUtil
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top