File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Unable to write .Js file in the client machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic

Unable to write .Js file in the client machine

Saravanamuthu Krishnan

Joined: Sep 12, 2005
Posts: 6
We have a requirement wherein data retrieved from the database needs to be written to a .js file and stored in the client machine. This is to achieve optimum performance. When i try to access the site from the same machine that hosts the webserver the file gets written and I m also able to read values from the written file thro' client-side Javascript. But when I attempt to load the site from a different machine, the file doesn't get written on the client machine. Any suggestions.

ALso request your comments on the following..
Which is the best way to handle multiple page reultsets.
1. Assuming 10 is max-number of records to be displayed- retrieve the first 10 records for the first page and when "NEXT" is pressed get the next 10 from the database and so on (or by using cachedRowSet).
2. Write data to a .js file and read its contente from client-side Javascript.
3. Store the retrieved values in a client-side Javascript variable.

Daniel Rhoades
Ranch Hand

Joined: Jun 30, 2004
Posts: 186
May I be the first to say - why have you decided to store data in a JavaScript file?

As that's a wee bit crazy...

Drinking more tea is the key...
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Duplicate Of:

Where you already have an answer.
Please don'tcross-post
your questions in multiple forums.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Please don't post duplicates, they make me sad
I agree. Here's the link:
subject: Unable to write .Js file in the client machine
It's not a secret anymore!