Handling optional parameters in a servlet I have a form that submits to a servlet that has optional parameters. If they are empty they are just ignored. This is the template I am using:

if (!(param = (String)params.get("httpParam")).equals("")) {
   // Handle parameter
}


It doesn't quite feel right. It works, but I think it could be more readable. Any suggestions?
I suggest extract code for getting parameter to separate method (see extract method refactoring's tehnique):

param = getOptionalParameter("httpParam");
if (! param.isEmpty()) {
    // Handle parameter
}