Can someone explain why String and Class annotation parameters are expected differently? Why does the compiler require literals for Classes, wherby accepting constants for Strin
I got the "annotation value must be a class literal" on the following:
@ServerEndpoint(value="/story/notifications",
encoders = (StickerEncoder.class),
decoders = (StickerDecoder.class))
This happening whilst following one of Oracles tutorials on websockets. Turns out the video is not the 720p quality and the fuzziness hides the braces which look like curly brackets. So the error disappears upon changing brackets (parentheses) for braces.
@ServerEndpoint(value="/story/notifications",
encoders = {StickerEncoder.class},
decoders = {StickerDecoder.class})
hth anyone who may trip over the same in the future.