-1

In my api.properties file, i have this:

command.void='voiditem'
...

I add single quote in both end of the value to ensure spaces are being escaped however it is being rendered as it is (single quote is still there).

@Value("${command.void}")
String command;
...
System.out.println(commad); //displays: 'voiditem'

What went wrong?

Orvyl
  • 2,635
  • 6
  • 31
  • 47
  • 1
    Nothing went wrong. What did you expect? – Oleg Estekhin Jun 16 '14 at 10:59
  • it displays as its a value for command.void key – vikeng21 Jun 16 '14 at 10:59
  • @orvyl there is no need to put the string in quotes –  Jun 16 '14 at 11:02
  • I am using single quote to escape spaces (http://stackoverflow.com/questions/6537716/how-to-handle-single-quotes-in-internationalization-constants). I am expecting to have `voiditem` and not `'voiditem'`(with quotes). Anyway, I should really remove single quote – Orvyl Jun 17 '14 at 01:32

2 Answers2

3

You don't need the quotes. There are some examples of using properties here:

http://en.wikipedia.org/wiki/.properties

2

There is no need to keep single quote in the properties file.

You get values with trimmed spaces.

Ninad Pingale
  • 6,801
  • 5
  • 32
  • 55