aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes about  URLEncoding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "about  URLEncoding" Watch "about  URLEncoding" New topic
Author

about URLEncoding

ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 194
Hi ,

As per my knowledge,when we submit a form then based on ENCTYPE attribute application/x-www-form-urlencoded or multipart/form-data is used by the browser to encode the form data.
But i have seen on some jsp pages that the value of input variables are explicitly being encoded using URLEncoder.Then on server side they are decoded using URLDecoder.What is the reason behind this?
Please let me know.

regards,
Ajse
Greg A Watson
Greenhorn

Joined: Mar 28, 2006
Posts: 6
Sounds like an approach to counter Cross Site Scripting attacks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

Special characters must be encoded if they are going to be part of the URL. When this isn;t being done by a form submission, it must be done "by hand".


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about URLEncoding