我這樣做:在html標記逃生網址
<a href="http%3A%2F%2Flocalhost%3A8080%2Fnews.xhtml%3Fid%3D32%26lang%3Den" target="_blank" />
當這個被渲染,該鏈接指向:http://localhost:8080/news.xhtml?id=32&lang=en
我需要這個鏈接指向的URL編碼而不是解碼的那個。
有誰知道如何逃脫它?
更新(根據評論):我需要它來實現在Facebook上分享這個功能。要做到這一點的方法是撥打以下鏈接:http://facebook.com/sharer.php?u=<encoded url to share>
未來請在問題中添加更多*上下文*以便整個功能要求是明確的,而不是問一半的問題;) – BalusC 2010-01-28 22:56:56