JSON no cache data access

2010-07-06 Thread txciggy
Hi,

In my GWT application, I am using JSON async callback mechanism
(JSONP) to retrieve data from server side. Earlier I used cgi-bin perl
scripts on server side to retrieve data and return http object back to
the client (browser) via async callback function call. I figured that
resource usage is much higher for cgi-bin scripts. Hence I moved away
from cgi-bin scripts and instead resorted to passing data directly
from a data file in web root's path through a HTTP get request. That
is I am populating a data file located at WEB-ROOT/json/query_data
periodically. This is being updated a separate polling process on the
same server. This is read by client periodically to fetch JSON data.
Instead of calling a cgi-bin script such as WEB-ROOT/cgi-bin/query.pl
which does nothing but read query_data and package it into a HTTP
header and passes it back through output stream back to client, I am
attempting to directly read the JSON data file in my new
implementation where the data file is pre-formatted to look like a
callback function call.

eg: INITIALLY
--

WEB-ROOT/json/query_data:

{..},...{..}

which is just an array of JSON objects.

WEB-ROOT/cgi-bin/query.pl :

#!/usr/bin/perl
use CGI;
use Fcntl qw(:DEFAULT :flock);

$q = CGI->new();
print $q->header();

# Read data from /tmp/json/query_data on an exclusive file lock
open($file, "< /tmp/json/query_data")
or die "{\"type\":\"JSONError\"}\n";
flock($file, LOCK_SH)
or die "{\"type\":\"FileLockError\"}\n";
@raw_data=<$file>;
close($file)
or die "can't close file: $!";

# Print JSON objects
print "callback123([";
foreach $line(@raw_data) {
print $line;
}
print "]);";

When this script is called by client side code, JSON data from
query_data is packaged into "callback123();" so that data is
transferred over as a JSON object through a asynchronous callback
mechanism. In my current implementation, I chose to bypass the above
cgi-bin script  and instead, directly access the /tmp/json/query_data
file by creating a symbolic link in WEB-ROOT so that client can access
this file by just specifying URL "http:///json/query_data".

CURRENTLY:
---

WEB-ROOT/json/query_data:

callback123([{..},...{..}]);


client calls - http:///json/query_data and expects JSON object
to be returned. This seems to work fine for the first request. However
subsequent requests still fetch cached data from previous
http:///json/query_data access. I verified this by opening the
above URL on browser. On repeated navigation to this URL, instead of
getting updated data, I keep getting stale data from previous trial
and only a page "refresh" seems to actually go and fetch updated info.
How do I go around this?

Thanks,
Rajiv

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



javac compile error

2010-04-15 Thread txciggy
Hi,

I'm a newbie to command-line compiling. I have used Eclipse before to
compile GWT projects without any problem. This is the first time I
have had to deal with automating javac compiling and ant build using a
Makefile. I am getting the following compiling error. I haven't found
anything related on the forum yet.


$ make
.. building with ant
Buildfile: build.xml

libs:

javac:
[javac] Compiling 58 source files to /home/rr208664/FabricMonitor/
war/WEB-INF/classes
[javac] --
[javac] 1. ERROR in /home/rr208664/FabricMonitor/src/com/sun/
fabricmonitor/client/chart/Chart.java (at line 22)
[javac] public class Chart extends FlowPanel{
[javac]^
[javac] The type Iterable is not generic; it cannot be
parameterized with arguments 
[javac] --
[javac] 1 problem (1 error)

BUILD FAILED
/home/rr208664/FabricMonitor/build.xml:30: Compile failed; see the
compiler error output for details.

Total time: 2 seconds
make: *** [gwt] Error 1
$


This project compiles without any problem in Eclipse. My Chart class
is straightforward:

=
public class Chart extends HorizontalPanel{

private SimplePlot plot;
.
.
.

public Chart() {

  ...
}
.
.
.
.

public void setSampleRate(int rate) {
  
}

public void setChartSize(int height, int width) {
  
}

}
=

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.