开发者

How to remove the space in the URL using java?

We use the URL for Unsubscribed portion for Bulk Email. Apparently, The email is went to the spam folder. Then the URL contains spaces in two places. Otherwise it can't contain space and works fine. One occurs in the name of the api (i.e api=getOutsideUnsub scribeContact). Anot开发者_如何学运维her one space is occured in the parameter values (i.e &h 5p8pKsyMi8l0)

For example:

Click here <http://XXX.XXX.XXX//servlet/ZoniacServlet?api=getOutsideUnsub scribeContact&e66Ve62i57=true&m9UCc1ucRi=634&h2BNp44yL7=184621&h 5p8pKsyMi8l0=0&h2ZNp64yM8=null&h2TNp86wP9=5&h2GQy54sI2=1717> to unsubscribe.

How can I remove the leading and trailing edge of the space in the URL?


Use

URLEncoder.encode(String s, String enc)

it will replace spaces with + signs as required.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜