Update products.jsp

refracted code to make it more reusible