Special characters in the URL must be escaped.
1. Replace space with the plus sign (+)
2. The forward slash (/) is used to separate directories and subdirectories.
3. Question mark (?) Separate URLs and queries
4. Specify special characters for the percent sign (% ).
5. # specifying bookmarks
6. & # separator Parameters
Causes of escape characters:
If your form is submitted using the get method and the submitted parameters contain special characters such, on the service end, the & parameter is treated as another parameter. For example
The form action is list. JSF? Act = Go & State = 5
Then, request. getparameter can be used to obtain the values of act and state.
If your intention is the act = 'go & State = 5' string, You must escape & to get the exact act value on the server.
Principles of URL escape characters:
Convert these special characters into ASCII codes in the format of % plus the ASCII code, that is, a percent sign %, followed by the ASCII (hexadecimal) value of the corresponding characters. For example, the Space Encoding value is "% 20 ".
The URL special symbol and the corresponding hexadecimal value encoding:
1. In the + URL, the plus sign indicates space % 2B
2. the space in the space URL can be + or encoded as % 20
3./separate directories and subdirectories % 2f
4 .? Separate the actual URL and parameter % 3f
5.% specify special characters % 25
6. # indicates bookmarks % 23
7. & separator between parameters specified in URL % 26
8. = value of the specified parameter in the URL % 3d
Special characters in the URL must be escaped.