I have never noticed before. In fact, there are two ways to compile Java into. Class.
The default release method is javac, while the myeclipse tool we often use uses the debug mode.
The differences are as follows:
Function parameters change in release mode.
Test. Java
public class Test{private static void sayHello(){System.out.println("Hello world");}public static void main(String[] args){sayHello();}}
Use javac commands and myeclipse ide To compile test. Java
Then use jd-gui.exe to view test. Class
It can be found that the test. Class (below) generated by the javac command is different from the parameter name compiled by myeclipse (below ).
public class Test{ private static void sayHello() { System.out.println("Hello world"); } public static void main(String[] args) { sayHello(); }}
public class Test{ private static void sayHello() { System.out.println("Hello world"); } public static void main(String[] paramArrayOfString) { sayHello(); }}
This also explains why we recommend that you specify a name for the Controller annotation initialization parameter in spring MVC.
@RequestMapping(/test/{str})public String test(@PathVariable String str){ System.out.println(str); return null;}
The actual project deployment uses the release version, so that STR is not the {STR} In requestmapping. Such problems won't be discovered during development.