Java Reference
In-Depth Information
} catch (MalformedURLException e) {
resp.getOutputStream().println(e.getMessage());
} catch (IOException e) {
resp.getOutputStream().println(e.getMessage());
}
}
}
You can use URL Fetch to retrieve and parse XML documents, call RESTful web
services, and read RSS feeds. If you want to look at a REST-based web service
example, set the URL to http://ws.geonames.org/findNearby?lat=47.3&lng=9. This is
an example of an XML-based web serviceXML-based web service that exposes a
public REST API to return nearby country codes. Next, you'll take a quick look at
another App Engine service for manipulating images.
Images Service
App Engine has a service, Images service, which can be leveraged for image
manipulation. To demonstrate how to use this service, we'll walk you through the
creation of a basic servlet that will flip uploaded images on the vertical axis. You'll
continue to build on the same Eclipse project, but you need to add some more
libraries:
1. This example uses the Apache Commons FileUpload package.
Start by downloading that package from the following location:
http://commons.apache.org/fileupload. We're using Version 1.2.1
for this example. Download and unzip the binary distribution of
the package.
2. Drag the commons-fileupload-1.2.1.jar file from the lib directory into
the WEB-INF/lib directory on the Eclipse Package ExplorerEclipse
Package Explorer of your project.
3. Right-click the file in the Eclipse Package Explorer and select Build
Path
Add to Build Path.
4. You also need to use the Apache Commons IO library. Repeat the
previous steps after downloading Commons IO from http://
commons.apache.org/io. We're using version 1.4 for this example.
 
Search WWH ::




Custom Search