aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes about  URLEncoding Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "about  URLEncoding" Watch "about  URLEncoding" New topic
Author

about URLEncoding

ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 192
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: 56554
    
  14

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".


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: about URLEncoding
 
Similar Threads
struts
File upload doesn't work when additional form elements introduced
How to insert form-data(.jsp) into MySql through Servlets
multipart form/data- form field
EHCache not working