Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8783807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:55:17+00:00 2026-06-13T20:55:17+00:00

Probably it’s not possible, but I would like to transform a json string in

  • 0

Probably it’s not possible,
but I would like to transform a json string in a map with freemarker

ex:

<#assign test = "{\"foo\":\"bar\", \"f\":4, \"text\":\"bla bla\"}">

and be able to get the text key from this string

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:55:18+00:00Added an answer on June 13, 2026 at 8:55 pm

    Use ?eval_json (requires FreeMarker 2.3.31):

    <#-- Using '...' instead of "..." for convenience: no need for \" escapes this way. -->
    <#assign test = '{"foo":"bar", "f":4, "text":"bla bla"}'>
    <#assign m = test?eval_json>
    
    ${m.foo}  <#-- prints: bar -->
    
    <#-- Dump the whole map: -->
    <#list m as k, v>
      ${k} => ${v}
    </#list>
    

    Before 2.3.31, ?eval was popular for this purpose, but that actually expects FreeMarker expressions. That’s a problem because it doesn’t support null, or \uXXXX escapes (so parsing of such JSON will fail). Also it can be a security problem, because it supports accessing variables, and calling methods/functions, while JSON doesn’t.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Probably not. But still would be nice to have it. Kinda hard to believe
Probably right in front of me, but I am not sure how to set
Probably not the best title I've ever written, but I find it hard to
probably an obvious question but Oracle Technet is not being friendly with my search
Probably this will not result in any noticable performance difference, but I was just
Probably a simple question, but I'm not that good with loading files… Getting my
Probably a simple answer here, I hope, but seems like a difficult question to
Probably not the best wording for that question but... I understand there are things
Probably not double buffering but I'm trying to make a highlighter (pure amusement) using
Probably over analysing this a little bit but how would stackoverflow suggest is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.