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

  • Home
  • SEARCH
  • 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 6536047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:26:43+00:00 2026-05-25T10:26:43+00:00

I try to parse a JSON string with the net.liftweb.util.JSONParser. It’s parse() method returns

  • 0

I try to parse a JSON string with the net.liftweb.util.JSONParser. It’s parse() method returns a Box[Any] value which I want to process via pattern matching like this:

JSONParser.parse("{foo: 'xxx', bar: 'yyy'}") match {
        case Full(Map) => println("ok")
        case x => println(x)
}

I’d expect this code to print “ok” but instead it prints

 Full(Map(foo -> xxx, bar -> yyy))

Does anyone have an idea what’s wrong with my statement?

  • 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-05-25T10:26:43+00:00Added an answer on May 25, 2026 at 10:26 am

    Updated:

    scala> import net.liftweb.util._
    import net.liftweb.util._
    
    scala> import net.liftweb.common.Full
    import net.liftweb.common.Full
    
    scala> JSONParser.parse("{foo: 'xxx', bar: 'yyy'}") match {
     | case Full(m: Map[_, _]) => println("ok")
     | case x => println(x)
     | }
    ok
    
    scala> 
    

    (I had forgotten the Full() around the Map[,]

    I don’t know your requirements, but Lift also has a another json library which is more powerful than JSONParser, it is called lift-json

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

Sidebar

Related Questions

I try to get parse JSON response for the following link: https://graph.facebook.com/feed/?ids=135395949809348,149531474996&access_token= The response
I'm trying to parse a JSON object, part of which looks like this: {
I have the following Python code: import xml.dom.minidom import xml.parsers.expat try: domTree = ml.dom.minidom.parse(myXMLFileName)
I want to use the DateTime.TryParse method to get the datetime value of a
try { ... } catch (SQLException sqle) { String theError = (sqle).getSQLState(); ... }
I'm trying to parse some JSON data from the Google AJAX Search API. I
Is there any reasons why PHP's json_encode function does not escape all JSON control
I send a valid JSON string to my PHP page from jQueryscript: var data
I'm coding in C# for the .NET Framework 3.5. I am trying to parse
I must receive the following JSON: { method:methodName1, args:{ arg1Name:arg1Value, arg2Name:arg2Value } } Here's

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.