devxlogo

Tip Bank

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,

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

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

A Power Function for Integers

Need a quick and dirty way to exponentiate integers? Or perhaps you are working on a number library of your own. This will work in all cases. templateTYPE power(TYPE x,