小编eFo*_*Fox的帖子

如何从http或https请求获取带端口的主机名

我在jboss容器中部署了两个应用程序(相同的unix框).如果我从app1收到请求,我需要为app2设置相应的请求.

例如:
如果app1请求是:http://example.com/context? param1 = 123
然后我需要提取" http://example.com/ ",以便我可以构建第二个应用程序的请求.

我试过用:

  HttpServletRequest.getServerName() & 
  HttpServletRequest.getServerPort() & \
  HttpServletRequest.getHeader("host") 
Run Code Online (Sandbox Code Playgroud)

方法,但请求可能是http或https.

如果还有其他更好的方法,请告诉我.谢谢!

java servlets http httprequest http-headers

29
推荐指数
5
解决办法
10万
查看次数

git rebase -i 在 rebase 和强制推送后显示错误的提交历史记录

在将一个分支重新建立到另一个分支上后,我遇到了一个有趣的问题;git rebase -i HEAD~n不仅显示错误的提交历史记录(旧分支),还显示错误的提交数量。

我想做的事

我希望能够对git rebase -i HEAD~n正确的提交历史记录进行操作,以便压缩我基于分支的旧分支的剩余提交。

我做了什么导致了这个问题

# On another Feature branch
git branch -b NewFeautureBranch
# Develop my commit
git add editedfile.extension
git commit -m "Commit message"
# I squashed and merged the feature branch into the development branch, as well as some other feature branches
git fetch --all
git checkout DevelopmentBranch
git pull
git checkout NewFeatureBranch
git rebase DevelopmentBranch
git push -f
Run Code Online (Sandbox Code Playgroud)

运行git loggitk会显示应有的历史记录,这是我当前的提交和它最初基于的功能分支的较旧提交,如预期的那样。然而,如果我随后运行,git rebase -i …

git command-line git-rebase windows-10

5
推荐指数
1
解决办法
7247
查看次数