Accessing the same file

Toshiharu

New Member
I have a situation where in I write to a text file programmatically using java and simultaneously I read from the same file using jQuery. The problem I face is jQuery is unable to find the updated content whenever a content is written into the text file via java.I have Googled a lot but the only results I find are for java and java processing and not for java and javascript (i.e A Client side and Server side)I am not sure if this is even possible.More about the question: I write into the file the crawling results using java and I am trying to display the same using javascript (jQuery.post() method). JAVAA multi-threaded crawling program that crawls a website and does some functionality. I am trying to write some content into a text file using the same java program as and when the crawling happens. The content I write mostly are the details about which thread is getting invoked and what is the current link that is being crawled. The reason I write this in the text file is I need to show the output in the UI so that people looking at the UI will understand what happens.Writing happens perfectly as expected.JAVASCRIPT (jQUERY)This using the \[code\]jQuery.get or post ("sample.txt", function (result) { $("#someID").html(result); });\[/code\]It reads from the text file normally but when java and javascript both are trying to access the file, It is the java that dominates leaving javascript behind thus jQuery is unable to fetch the updated content as and when it happens.I guess this explanation is more than sufficient to make people understand what exactly my problem is !Any help is appreciated.Thanks in advance
 
Back
Top