/    Sign up×
Community /Pin to ProfileBookmark

JSON Parameter passing.

Hi,

From one of my application I want to access the page of an another application, so I want pass some parametres from the first application.
I thought of using JSON. How I can pass the parameters with the URL using JSON.
Can anybody help me.

I am using Jdk 1.3

Thanks a lot

Ashok

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@tianxzJun 24.2009 — you can call the url of script with parameter.
Copy linkTweet thisAlerts:
@tianxzJun 24.2009 — it is same to the URL without parameter. just like http://www.com?p1=p&p2=p
Copy linkTweet thisAlerts:
@ashokvrauthorJun 25.2009 — hi,

Thank you for the reply.

My requirement is to pass the parameters through POST method in a variable named “ARGS” which stores a string object that implements JSON.

{

param1:string,

param2:string

}

What will be URL generated by this request.

Thanks,

Ashok
Copy linkTweet thisAlerts:
@ashokvrauthorJun 25.2009 — I am using "json-lib-2.2.3-jdk13.jar"

then the URL from the source application will be like

http://....../index.jspl?paramName={param1:"value",param2:"value"}

can you please tell me from the target application how can I receive the

parameters.

I tried the following code

String strJSON = request.getParameter("paramName");

JSONObject jsonObject = (JSONObject) JSONSerializer.toJSON(strJSON);

String Message1 = jsonObject.get("param1").toString();

String Message1 = jsonObject.get("param2").toString();

but I am getting some errors

can you tell me wats wrong in this code.

Regards,

Ashok
×

Success!

Help @ashokvr spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...