Expressing a character string of the operator in Request

xiaoxiao2021-03-06  59

(Skills, extracted)

For example, there is a link in the web, ... / mytest.jsp? Id = 1 & PTDM = A B When I submit, the value obtained using Request.GetParameter ("PTDM") is not A B, but a

How can I get A B?

Very simple

/ ITest.jsp?id=1&ptdm=a+b

Use% 2B instead of number

In Java is a connection string operator, while the parameter is passed during the seating parameter cannot pass an expression. So if A B is an expression, it is best to calculate the results before reproduction. If you want to pass an expression, you can assign this expression to a string variable, then pass this variable, such as string a = a b transfer: mytest.jsp? Id = 1 & PTDM = <% = a%>

If only pass , you should use the following string instead of special characters.

Special character's meaning ---------------------------- Character special character's meaning URL encoding # is used to mark a specific document position% 23 % Coding% 25 & Separation of Special Characters Different Variables Variable Value Variety Number 2B / Represents Directory Path% 2B / Representation Directory Path% 2F = 3D to Connect the Key and Value% 3D? Representing the start% 3F of the query string

If is the role of the connection, then "mytest.jsp? Id = 1 & ptdm =" A B, then pass

转载请注明原文地址:https://www.9cbs.com/read-111864.html

New Post(0)