ITeye博客

取JSP,Action中全路径的方法

xdlvpei · 2010-03-02 14:02 · Struts2 · 企业架构 · Java · JSP · Markdown

取JSP,Action中全路径的方法JSP中:${pageContext.request.contextPath}

利用EL表达式,相当于http://localhost:8080/应用名称Jave类中:

String path = request.getScheme()+"://" + request.getServerName()+ ":"+ request.getServerPort()+ request.getContextPath();

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。