Currently, I am developing a spring-boot application and one of the rest controllers looks as follows:
@RequestMapping(value = VALUE)
public class SomeControllerClass {
public final static String VALUE = UUID.randomUUID().toString();
...
}
While developing this, I have encountered this issue when setting VALUE for @RequestMapping
Attribute value must be constant
However, if I alter the static field assignment as it's presented below everything works fine:
public final static String VALUE = "someValue";
Now, I am wondering what are the differences (in terms of java constant meaning) between:
public final static String VALUE = "someValue";
and
public final static String VALUE = UUID.randomUUID().toString()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…