on 03-22-2016 6:07 AM
Hi,
I was successful in creating JAM extension Using HCP with the great help of Robert, Adam and James. Now im trying to change the format of the output that we get in JSON format. This output will contain number of data displayed on the screen whenever some function is performed. Here my question is, is that possible to get only some important data from the JSON file.
For example: When the new Group is created by giving the Group name using createGroup functionality we get the following JSON file as output indicating that particular group is created in JAM.
{
d:
{
results:
{
_metadata{
uri:
type:
},
id:
description:
...
...
...
}
Here can we get just the Group name, Group ID and Created By as the output. Can anyone please help me out in this.
Many Thanks & Regards,
Soumya
Could anyone please help me out in this issue, whatever i'm trying to change the .jsp code to fetch the separate values from the JSON output, i'm getting class compilation error.
Thanks in advance,
Soumya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Attached is the error im facing while execution.
I have added a for loop in the .jsp file as below:
if( responseEntity != null)
{
String responseString = EntityUtils.toString(responseEntity);
for(int i=0; i<responseString.length; i++)
{
out.println(responseString);
}
}
i wanted to fetch the particular values from responseString. So i thought if im getting separate values using for loop from there i can fetch the needed values.
But nothing worked, whatever code i change im getting the same compile error.
Can u pls suggest me with some other code where the particular values can be fetched.
Regards,
Soumya
You have a syntax error on this line:
for(int i=0; i<responseString.length; i++)
It should be:
for(int i=0; i<responseString.length(); i++)
Generally speaking, if you are getting a compiler error, you want to go into the application server logs, in this case since you are using HCP as your application server, you can go into the Java application properties in HCP and there is a log section that you can download the logs from to review. These logs will give you more details around what the actual error is.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.