Hi,
I use the URL-Fetch Service to read an url from my server.
If I change the corresponding html-file on my server I get the old
content.
If I call the servlet many times I sometimes get the old content and
somtimes (more seldom) I get the new content.
If I fetch the site with a browser I always get the new content (as
expected).
Here is the code for the servlet:
public class Readpage extends HttpServlet {
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
URL url = new URL("http://wlwtest.babuco.com";);
HttpURLConnection connection = (HttpURLConnection)
url.openConnection();
InputStream inputStream = url.openStream();
InputStreamReader inputStreamReader = new
InputStreamReader(inputStream);
BufferedReader reader = new BufferedReader(inputStreamReader);
int i=0;
String line;
while ( (line = reader.readLine()) != null) {
out.println(line);
}
inputStream.close();
inputStreamReader.close();
reader.close();
out.close();
}
}
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.