其他分享
首页 > 其他分享> > getServletContext().getRealPath和${pageContext.request.contextPath}

getServletContext().getRealPath和${pageContext.request.contextPath}

作者:互联网

String path =
getServletContext().getRealPath("/WEB-INF/new_words.txt");

输出:pathD:\IdeaProjects\itcaststore\target\itcaststore-1.0-SNAPSHOT\WEB-INF\new_words.txt

${pageContext.request.contextPath}:定位webapp文件夹

标签:WEB,itcaststore,contextPath,request,getServletContext,getRealPath,new,txt
来源: https://blog.csdn.net/qq_31255557/article/details/115493478