请教转义符问题(急)

nobody_tony 2007-12-08 02:50:48


向服务器端提交请求,内容举例:http://127.0.0.01/register.do?businessname=a & b.com&phone=123456789

公司名是a & b.com,其中包含&, 请问我该如何转换。

Thanks a million.

...全文
27 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
encode the ampersand & before submit the form and decode it on the server side

in UTF-8, ampersand would be converted to %26 if you use java.net.URLEncoder.encode(String,"UTF-8");

or do direct conversion on the client side to replace "&" character by &

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧