首页 > 编程语言 > 详细

[Java][Web]Web 工程中的各类地址的写法

时间:2017-05-16 23:58:30      阅读:357      评论:0      收藏:0      [点我收藏+]

// 1.

request.getRequestDispatcher("/index.html").forward(request,response);

// 以 / 开头,对于浏览器 / 表示网站,对于服务器 / 表示当前的 web应用

// \ 反斜杠 用于访问硬盘资源的路径分隔符

// 2.

response.sendRedirect("/day05/index.html");

// 3.

this.getServletContext().getRealPath("/index.html");

// 4.

this.getServletContext().getResourceAsStream("/public/foot.jsp");

// 5. html / jsp 页面

<a href="/day06/index.html">链接</a>

<form action="/day06/index.html">表单</form>

[Java][Web]Web 工程中的各类地址的写法

原文:http://www.cnblogs.com/z5337/p/6864234.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!