Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

How to pass a String parameter as a non-array?

I'm passing a String parameter into a java function I wrote.

When I pass the string parameter the method is accepting my parameter as follows http://mywebsite.com/getCity.php?StateID={"state":"Alabama"}

I want my method to accept my string parameter as follows http://mywebsite.com/getCity.php?StateID=Alabama

How do I get rid of {"state":"Alabama"}?

Hi Shane can you paste here the method declaration or part of the code where it's being set? It will be helpful to know what parameters are being set

Ken Alger
Ken Alger
Treehouse Teacher

Shane;

Did you get you question answered over at Stack Overflow?

Ken

Hi Guys

Thanks for your replies. It seems as if this was the correct answer

http://stackoverflow.com/questions/26395003/pass-a-string-parameter-as-a-non-array/26396087#26396087