Tip Bank

DevX - Software Development Resource

DecodeBase64 – Decoding a string from base64

‘ Returns the input string decoded from base64Private Function DecodeBase64(ByVal input As String) As String Dim strBytes() As Byte = System.Convert.FromBase64String(input) Return System.Text.Encoding.UTF8.GetString(strBytes)End Function

DevX - Software Development Resource

EncodeBase64 – Encoding a string to base64

‘ Returns the input string encoded to base64Private Function EncodeBase64(ByVal input As String) As String Dim strBytes() As Byte = System.Text.Encoding.UTF8.GetBytes(input) Return System.Convert.ToBase64String(strBytes)End Function

DevX - Software Development Resource

Set Attributes in a Servlet Request

Usually, you set attributes in a session and the attributes are available through out the session. If you want to limit the scope of an attribute to just a request,

DevX - Software Development Resource

The Beans Class

The standard Java library contains a host of valuable methods. Many of these are hidden away, such as Beans.isInstanceOf.This method belongs to the java.beans.Beans class. However, it’s an object version

DevX - Software Development Resource

Loading from the Classpath

If your application includes .properties files or images and you want to load them without hard-coding their location, store the files in the class path. Classes are stored in archive