1) Request tool class org. springframework. Web. Bind. servletrequestutils // Obtain the integer of the request parameter: public static integer getintparameter (servletrequest request, string name) public static int getintparameter (servletrequest request, string name, int defaultval) --> Single value Public static int [] getintparameters (servletrequest request, string name) --> Array For example Long, float, double, Boolean, string . 2) string tool class org. springframework. util. stringutils Uppercase: public static string capitalize (string Str) lowercase: public static string uncapitalize (string Str) judge whether the string is null or empty: public static Boolean haslength (string Str) judge whether the string is a non-blank string (that is, a string containing at least one non-space): Public static Boolean hastext (string Str) Get the file name: public static string getfilename (string path) such as e.g. "mypath/myfile.txt"-> "myfile.txt" get the file extension: public static string getfilenameextension (string path) such as "mypath/ Myfile.txt "->" TXT "also includes array-to-set, set-to-array, path processing, string splitting into arrays, array or set merging into strings, array merging, adding elements to arrays, etc.. 3) Object serialization and deserialization org. springframework. util. serializationutils Public static byte [] serialize (Object object) public static object deserialize (byte [] bytes) 4) digital processing org. springframework. util. numberutils The string is converted to a number and formatted, including the specific number implementation classes, such as long, integer, and double. The string supports a hexadecimal string, and spaces in the string are automatically removed: public static <t extends number> T parsenumber (string text, class <t> targetclass) public static <t extends number> T parsenumber (string text, class <t> targetclass, Numberformat Numberformat) conversions in various numbers, such as long for integer, automatically handle number overflow (throwing an exception): Public static <t extends number> T convertnumbertotargetclass (Number, class <t> targetclass) 5) copy the org. springframework. util. filecopyutils file. Stream-to-stream, stream-to-string, byte array-to-stream Replication 6) Directory ReplicationOrg. springframework. util. filesystemutils Recursively copy and delete a directory 7) MD5 EncryptionOrg. springframework. util. digestutils MD5 encryption of byte arrays public static string md5digestashex (byte [] bytes) |