首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

Servlet中URL与URI的差异

2012-09-03 
Servlet中URL与URI的区别看我给你举个例子---ServletPath,ContextPath,URI,URL4个的比较request.getServle

Servlet中URL与URI的区别

看我给你举个例子---ServletPath,ContextPath,URI,URL4个的比较


request.getServletPath()-----/user/register.action
request.getContextPath()-----/testWeb
request.getRequestURI()-----/testWeb/user/register.action
request.getRequestURL()-----http://localhost:8080/testWeb/user/register.action

testWeb是你的web项目(工程)名
struts2下位register.action,struts1.x下位register.do

热点排行