In JS:
Main Topics
Browse All Topicsi am trying to rename "displayName" key to"text",
where key "dispalyname" is a part of JSONArray which is nested in JSONObject.
like:
{"jsonText":[
{"description":"Employee",
{"description":"Former Employee","displayName":"L
{"description":"Employee",
]}
Can anyone suggest way to rename ?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
K got your point..
Thanks , but the change i am trying to do is on server side i.e. in a servlet.
So i don't think this will help.
I am passing this JSON object to my javascript and there my jquery will read it for an JSONsuggest function.
my JS file for JSON suggest (plugin in jquery) expects the searchdata key to be "text", that's why i need to rename it from displayName to text
i got the solution, i sat and applied my brain's deepest nerves to get it working in JAVA servlet itself.
I am calling this mapBeans fxn, and replacing my fields from JSONArray.
this fxn references the UserMappingBean which has getter and setter for Text field.
It works fine for me.
Thanks for the help.
Business Accounts
Answer for Membership
by: mplungjanPosted on 2009-07-10 at 04:28:07ID: 24822103
Perhaps add the new key with the value and remove the old ?