• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

escape the key word in applicationcontext.xml

 
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in the config file , i want to put following line:

<property name="jsonResultTemplate" value="{"result":{"name":"${action}","return":${result}}}">
but it is illegal, because it include the key words, how can i escape them?

thanks
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, it's illegal because you're nesting quotes all over the place: this is standard XML--once the parser sees a quote after the first one it things you're done defining the attribute. Fortunately JavaScript has two different quote characters.
 
zb cong
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and ${} conflict with the spring key word, once spring see it, it try to find the defination from properties files.

so i wonder if there are some way to set the json template in this file? i want to inject it to java bean.
 
reply
    Bookmark Topic Watch Topic
  • New Topic