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 9227039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:58:19+00:00 2026-06-18T04:58:19+00:00

Basically, I have a Map<String, String[] > which contains a bunch of strings with

  • 0

Basically, I have a Map<String, String[] > which contains a bunch of strings with a key. If I do String value = myMap.get("keyName");, this returns an Object rather than a string, and echoing it produces something like this: Ljava.lang.String;@1dfa166. Doing toString() doesn’t help either.

What do I need to do to get the value as string:

My code looks like this:

String value ="" + request().body().asFormUrlEncoded().get("keyName");

Here the asFormUrlEncoded() method is what returns the Map

  • 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-18T04:58:21+00:00Added an answer on June 18, 2026 at 4:58 am

    You’re getting back an array of strings (second parameter to the generic Map as declared).

    Change it to

    String [] values = myMap.get( "keyName" );

    and check values.length to see how many strings are in the array. If it’s just one, you can just access it as values[0].

    The reason it allows for a string array is because each key in the form could have multiple values, so it can’t return a single string.

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

Sidebar

Related Questions

I have this HashMap: HashMap<String, Integer> m which basically stores any word (String) and
I have a spring-hibernate application which is failing to map an object properly: basically
I basically have three tables, posts, images and postimages (this simply contains the ids
Ok guys I basically have a class which takes in 3 strings through the
I have a key/value pairs mapped by hash (ID) in Dictionary<string, Dictionary<string, string>> called
I have a data text file which contains this Map2D, [3, 2] Dot3D, [25,
I basically have a Money value type, which consists of Amount and Currency .
I have an app that saves google map markers, I basically save the lat
I basically have the following string in the format: A,B,C:D,E,F What I am trying
I have a database which contains tables of mapping values for a variety of

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.