During debugging today, we found a bug:
Java. lang. classcastexception: Java. lang. integer cannot be cast to Java. lang. stringorg. apache. JSP. complaintsearchlist_jsp. _ jspservice (complaintsearchlist_jsp.java: 93) Org. apache. jasper. runtime. httpjspbase. service (httpjspbase. java: 70) javax. servlet. HTTP. httpservlet. service (httpservlet. java: 717) Org. apache. jasper. servlet. jspservletwrapper. service (jspservletwrapper. java: 377) Org. apache. jasper. servlet. jspservlet. servicejspfile (jspservlet. java: 313) Org. apache. jasper. servlet. jspservlet. service (jspservlet. java: 260) javax. servlet. HTTP. httpservlet. service (httpservlet. java: 717) COM. tgx. servlet. complaintservlet. doget (complaintservlet. java: 120) COM. tgx. servlet. complaintservlet. dopost (complaintservlet. java: 142) javax. servlet. HTTP. httpservlet. service (httpservlet. java: 637)
Poor English is hard to understand. I didn't understand it at the beginning. I thought it was a string that could not be converted to an integer. I Was Wondering there, because it was okay to write it many times before.
Then I checked du Niang and understood. The exception indicates that the integer type cannot be converted to a string. Because it used to be like this. Request. setparameter ("SDF"); string DFD = request. getparameter ("SDF") when reading; this is legal. This is because data of the string type is stored.
This is the request. setattribute ("pagenow", pagenow); when reading, string s_pagenow = (string) request. getattribute ("pagenow"); this will not work. Because of the Data Type of the setattribute object, the corresponding data type should be used for reading. But it cannot be read using Int. It should be not of the object type. Integer should be used, and then converted to int data type.
The solution is complete.