I had created a web service where it receives the data and store it in database. For confirmation of storage to user i had shown the stored data as response in the same page as (where web service is processing) JSON output.
Now i have a doubt , Do the response can be redirected to the request page.
For your better understanding,
-
A user uploading the data from a html file (upload.html).
-
Now the web service will store the data in database (upload.java) and shows output as JSON in same page (current am using this way)
-
Can i take the response JSON output back to the html (upload.html) and show the JSON output
Is this way possible.
You are posting/sending data of user to server and then again you want to redirect response to the user. Why?
When user submits the data you already have it. So just format it and show appropriate message to the user. Showing message after redirection doesn’t add any value unless you want to show some message which is coming from server.
Edit
Web service tutorial
Check service code in above link; it returns String. Similarly you need to modify your service to return appropriate object.