在jsp中,获取已部署项目的realPath [英] in jsp, get realPath of deployed project

查看:146
本文介绍了在jsp中,获取已部署项目的realPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在servlet中,因为我们可以访问已部署项目的真实路径

in servlet, as we can access the real path of deployed project

ServletContext context = getServletConfig().getServletContext();
string contextStr = context.getRealPath(".....");

我如何在JSP页面中访问已部署的项目路径?

How can i access the deployed project path in JSP page, any idea please ?

推荐答案

<%=request.getRealPath("write_your_file_name")%>

这篇关于在jsp中,获取已部署项目的realPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆