Collecting static methods in classes called SomethingUtilities
(or SomethingUtils
or SomethingUtil
) is a pretty widespread convention, but ServletUtilities
as such is not.
Excessive use of such classes can be a sign that the author of the code has not really understood object orientation and is writing procedural code in an OO language, whereas moderate use of them just shows that for some tasks you really want standalone functions rather than classes.
Note that the code in the answer you cite is bad for a number of reasons:
- The name of the class should be directly related to what the static methods do, and XML escaping has nothing to do with Servlets.
- XML escaping is a very common task and potentially security-relevant, so you really shouldn't roll your own. Any XML parser or framework will have a way to do it that is almost certainly better than what you'll come up with on the fly. Or you can use Apache commons-lang which has
StringEscapeUtils.escapeXml()
(better class name, too!)