开发者

Read and write text files using Ajax, jQuery, Java

I have a requirement to read and write bulk of text files at server side.

How can we write using Ajax, Java... Have little bit idea about these technologies but I just need an idea to implement. After that I开发者_C百科 feel I can proceed. Could you please help me?


Firstly the text files are going to have to be publicly accessible. They cannot exist in a private context on the server, as JavaScript is a client side technology.

Once they are public, you can simply do an AJAX request on the file location, and then parse them as required.

If having them in a public location is going to be a problem, you will need to have a page that serves them to authenticated accounts only, so only people that are logged in can view them. This means they will have to be served via a server side script at some point, which the AJAX request can then fetch as required.

However if you take this approach, you might as well take out the AJAX and just have the server side script do the processing for you and feed out the result.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜