1) Request Tool class Org.springframework.web.bind.ServletRequestUtilsInteger value of the fetch request parameter: public static integer getintparameter (servletrequest request, String name) public static int Getintparameter (ServletRequest request, String name, int defaultval)--
Single Valuepublic static int[] Getintparameters (servletrequest request, String name)--
ArrayAnd, for example,
long, float, double, boolean, StringThe relevant processing methods.
2) String tool class Org.springframework.util.StringUtilsInitial capitalization: public static string capitalize (string str) Initial lowercase: public static string Uncapitalize (String str) Determines whether the string is null or Empty:public static Boolean haslength (String str) to determine whether the string is a non-whitespace string (that is, a string that contains at least one non-whitespace): public static Boolean HasText (String str) gets the file name: public static string GetFileName (string path), such as e.g. "Mypath/myfile.txt", "myfile.txt" Get file extension: public static string Getfilenameextension (string path) such as "mypath/ MyFile.txt "and" TXT "there are examples such as array-to-set, set-to-array, path-processing, string-separated array, arrays or collections merged into strings, array merges, adding elements to arrays, and so on.
3) object serialization and deserialization Org.springframework.util.SerializationUtilspublic static byte[] Serialize (Object object) public static Object deserialize (byte[] bytes)
4) Digital processing org.springframework.util.NumberUtilsThe string is converted to number and formatted, including the specific number implementation class, such as Long, Integer, Double, string supports 16 strings, and automatically removes spaces from the string: public static <t extends Number> T Parsenumber (String text, class<t> targetclass) public static <t extends number> T parsenumber ( String text, class<t> Targetclass,
NumberFormatNumberFormat) conversions in various numbers, such as long dedicated to integer, automatically handle digital overflows (throwing Exceptions): public static <t extends number> T Convertnumbertotargetclass (number number, class<t> targetclass)
5) file copy org.springframework.util.FileCopyUtilsReplication between stream and stream, stream to string, byte array to stream, etc.
6) directory replication Org.springframework.util.FileSystemUtilsRecursively copy, delete a directory
7) MD5 encryption Org.springframework.util.DigestUtilsByte array MD5 encrypted public static String Md5digestashex (byte[] bytes)
Useful Tools for Spring3 collection