Java Reference
In-Depth Information
Listing 8-11. Add to war/WEB-INF/lib/web.xml
<servlet>
<servlet-name>ImageTransform</servlet-name>
<servlet-class>com.kyleroche.gaeservices.ImageTransform</servlet-
class>
</servlet>
<servlet>
<servlet-name>ImageSource</servlet-name>
<servlet-class>com.kyleroche.gaeservices.ImageSource</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ImageTransform</servlet-name>
<url-pattern>/ImageTransform</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ImageSource</servlet-name>
<url-pattern>/ImageSource</url-pattern>
</servlet-mapping>
Testing the Service
You're ready to test the service. Locate a jpg file you can use for testing. In this
example, we're using the image of the topic cover. Start the application by choosing
Run As
Web Application from the Run menu in Eclipse. The application will start
up and display the path in the Eclipse console, as shown in Figure 8-7.
Figure 8-7. Path to the application shown in the Eclipse console (Mac OS X)
Open your browser to the URL shown in your Eclipse console. Click the Browse button
to select a file to upload. Navigate to the JPG image you selected earlier, select that
image, and then click Submit. The result of the upload is shown in Figure 8-8 where the
book cover is rendered along with a mirror image flipped on the vertical axis.
 
Search WWH ::




Custom Search