modify: add judgement of url is null (servletContext.getRealPath may be
null)