Java-ajax cross site empty response string?
-
I am doing a cross-site ajax to java data transaction(Not sure if I named that correctly, so please forgive me about that). Part of code in Java file: BufferedReader input = new BufferedReader( new InputStreamReader (connectionsocket. getInputStream() ) ); DataOutputStream output = new DataOutputStream( connectionsocket.getOutputStream() ); ... output.writeChars("some random text"); output.close(); Also I have index.php file with some jQuery: $(document).ready(function() { $("#send_data").click(function(){ $.ajax({ type: 'get', dataType: 'text', url: 'http://localhost:1024/' + $("#command").val(), success: function(data) {console.log(data);}, error: function() { console.log("Error"); } }) }); }); The command is sent correctly and received in Java side correctly. Then the request from java to ajax is 200 OK too. The output is also working. (For example if I remove output.close(), I do see in the firebug, that it is waiting for the output to be closed.) The only problem is, no matter what I do I get no response text. It's always an empty string :(
-
Answer:
you're adorable
kolibriz... at Yahoo! Answers Visit the source
Related Q & A:
- How to Implement Gateway Service something similar to Oracle API gateway Using Java and Java based Open Source frameworks only?Best solution by Quora
- How to see if one string contains another string?Best solution by Stack Overflow
- How to search for a particular string in a text file using java?Best solution by Stack Overflow
- I cannot empty my outlook in the box, can I empty the inbox all at once.Best solution by Yahoo! Answers
- What are the html symbols for a solid cross & upside down solid cross?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.