jsp用smartupload上传路径的问题

使用smartupload组件实现上传图片保存到tomcat服务器中(this.getServletContext().getRealPath("/")是服务器的路径),而在项目中是无法加载出来图片的,那么如何实现上传图片到项目中,进而可以引用上传的图片?

 this.getServletContext().getRealPath("/")
这个得到的就是你的web服务器的根目录。
因此如果你在页面上用 <img src="你的图片名" /> 就可以显示出图片。
jsp代码用this.getServletContext().getRealPath("/") + "/" + 你的图片名,也可以在代码中读取这个图片。