


Solution to the problem that Spring MVC cannot obtain the value of parameters normally (with code)
The content of this article is about the solution to the problem that Spring MVC cannot obtain the parameter value normally (with code). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you. .
I recently encountered a very strange problem during development. When using the Spring MVC framework in tomcat8, the method parameters in the Controller could not obtain the corresponding values normally. It was solved by changing the tomcat version to 7.0.
Record the following solution process, first the above picture:
Using this parameter passing method, the value of the parameter can indeed be received, but the method of receiving parameters and the method of passing parameters have become complicated. I copied this project home from the company and continued to write it. When I was at the company, everything was debugging fine, but when I returned home, it didn’t work. I was puzzled. I had not changed the same code, so why did something go wrong when I got home? ? Since the codes are the same but the running results are different, it only means that the running environment has changed. So where exactly is the environment different? When this kind of problem occurs, first consider the structure of the database. However, the database version of the home computer is the same as the company computer, and the data is copied directly from the company, so the database is directly ruled out, not to mention that it is received in the Controller. Without the parameters and the step of accessing the database, it is even less likely to be related to the database, so the cause of the database can be ruled out directly. Since the project is built by maven, the relevant jar packages are automatically downloaded by maven, so I wonder if there is a problem with the jar packages that maven automatically downloads. Then delete all the jar packages in the local warehouse and let maven start again. I downloaded it and repeated it several times, but the problem still existed. I had no choice but to temporarily rule out the cause of maven. In the end, I couldn't think of any other reasons, so I began to doubt the cause of tomcat. The company's tomcat is version 7.0, and the tomcat at home is version 8.0. Although the two tomcat versions are inconsistent, I didn't subconsciously think that it must be the tomcat version. After all, I subconsciously think that 8.0 must be an upgrade of functions after 7.0. Although I thought this way, I still went to the test with the mentality of being a dead horse and a live doctor. I downloaded the 7.0 version of the compressed package from the tomcat official website, then configured the corresponding environment and called it with postman. The result was so unexpected. Did you get the parameter value? ! ! ! Is it really because of the tomcat version? This feels too boring. . . . It seems that blindly pursuing higher versions is not a good thing [Related recommendations: Java Tutorial]
The above is the detailed content of Solution to the problem that Spring MVC cannot obtain the value of parameters normally (with code). For more information, please follow other related articles on the PHP Chinese website!

The article discusses using Maven and Gradle for Java project management, build automation, and dependency resolution, comparing their approaches and optimization strategies.

The article discusses creating and using custom Java libraries (JAR files) with proper versioning and dependency management, using tools like Maven and Gradle.

The article discusses implementing multi-level caching in Java using Caffeine and Guava Cache to enhance application performance. It covers setup, integration, and performance benefits, along with configuration and eviction policy management best pra

The article discusses using JPA for object-relational mapping with advanced features like caching and lazy loading. It covers setup, entity mapping, and best practices for optimizing performance while highlighting potential pitfalls.[159 characters]

Java's classloading involves loading, linking, and initializing classes using a hierarchical system with Bootstrap, Extension, and Application classloaders. The parent delegation model ensures core classes are loaded first, affecting custom class loa


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),