Code:
if(request.getSession().getAttribute("balance") = null && request.getSession().getAttribute("formattedBal") = null)
= is an assignment. For a condition test use ==.