How to URL encode a URL in JSP / JSTL?

前端 未结 4 537
北海茫月
北海茫月 2020-12-03 11:10

I want to create an encoded URL for my site. Say for example, for this URL: \"http://google.com/index.html\"

I want to give this URL to the client by URL encoding it

4条回答
  •  庸人自扰
    2020-12-03 11:42

    The accepted answer is missing some JSP code to be valid, it should be:

    
      
    
    
    Link to your client
    

    As a comment pointed out, another option is to use JavaScripts encodeURIComponent method.

提交回复
热议问题