jsp 中如何显示tomcat文件目录下的图片
比如图片的路径为 C:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/swfUpload/upload
[解决办法]
<%=application.getRealPath("/") %>
[解决办法]
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
basePath的路径应该熟悉吧:http://localhost:8080/swfUpload//
然后显示图片可以这样xie:<img src="<%=basePath%>/upload">