Home>

I. Elicitation of the problem

When doing an announcement browsing function,As long as a parameter value passed through the url contains∨the problem occurs-the value of the variable cannot be displayed.

Result of problem location:When encountering&, the value of this parameter will be truncated automatically.Causes the parameter value to be passed incorrectly.

Problem solving

The following tests are performed in the java code:

string charencode=java.net.urlencoder.encode ("&");

system.out.println ("Character&translated value:" + charencode);//Output:%26

So, the solution appeared --- before transmitting the parameters, Replace&all with%26

eg:

var url="page.jsp?para1=a&b"

Just make the following changes:

var url="page.jsp?para1=a%26b";

So far, the problem has been satisfactorily resolved.n_n

  • Previous Digital puzzle game based on Vuejs
  • Next AngularJS ng-mousedown directive