zoukankan
html css js c++ java
Java获取完整URL
/** */
/**
* 格式化中文字符,防止出现乱码
*
@param
str
*
@return
*/
public
String codeToString(String str)
{
String strString
=
str;
try
{
byte
tempB[]
=
strString.getBytes(
"
ISO-8859-1
"
);
strString
=
new
String(tempB);
return
strString;
}
catch
(Exception e)
{
return
strString;
}
}
/** */
/**
* 获取完整的Url
*
@param
request
*
@return
*
@throws
Exception
*/
public
String getBackUrl(javax.servlet.http.HttpServletRequest request)
throws
Exception
{
String strBackUrl
=
""
;
try
{
strBackUrl
=
"
http://
"
+
request.getServerName()
+
"
:
"
+
request.getServerPort()
+
request.getContextPath()
+
request.getServletPath()
+
"
?
"
+
this
.codeToString(request.getQueryString());
strBackUrl
=
java.net.URLEncoder.encode(strBackUrl,
"
gbk
"
);
}
catch
(Exception e)
{
throw
e;
}
return
strBackUrl;
}
查看全文
相关阅读:
Learning to Compare: Relation Network for Few-Shot Learning 论文笔记
修改python import模块中的变量
roslaunch保存的log文件没有打印的ERROR信息
python json demo
vscode 1.32.x按下鼠标左键无法拖曳选择,而旧一点的版本1.30.2可以
java-ee--------jdbc
集合
关键字
java面向对象
数组
原文地址:https://www.cnblogs.com/ding0910/p/1167143.html
最新文章
如何让自己阅读更多书籍:我用来每年阅读30多本书的简单方法
roscore启动不完全问题
树莓派4B切换国内源-亲测有效
ubuntu开机自启设置 Ubuntu16.04下测试OK
NVidia Jetson Ubuntu 18.04 安装ROS过程中运行sudo rosdep init指令出错
ROS catkin_make error Could not find a package configuration file provided by "actionlib_msgs"
vscode Markdown Preview Enhanced 安装配置
roslaunch 启动时修改参数
Ubuntu 16.04 Install NVidia Driver (download from nvidia official site)
Ubuntu 设置不更新某些软件
热门文章
Ubuntu 配置、使用samba共享文件夹
ubuntu 设置简单密码
Ubuntu 16.04 + Win10双系统 启动Ubuntu进入命令行 无界面
git常用命令
解决 conda tensorflow failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
conda基本用法笔记
pytorch 测试 迁移学习
神舟G7-CT7NK 安装tensorflow-gpu
ubuntu下安装teamiewer
python 截屏操作
Copyright © 2011-2022 走看看