added method to construct url according the servlet needs