servlet的几个函数
生活随笔
收集整理的這篇文章主要介紹了
servlet的几个函数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
request.getContextPath ? 上下文,例如 /bignews1 (自帶 “ / ”)
request.getScheme() 協議,例如HTTP
request.getServerName() 域名,例如localhost
request.getServerPort() 端口,例如8080
?
總結:比如,String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() ,
結果就是http://localhost:8080/bignews1/?
轉載于:https://www.cnblogs.com/xinyang/p/7208538.html
總結
以上是生活随笔為你收集整理的servlet的几个函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 日期年月日的比较以及判断
- 下一篇: 编程最佳实践