Java Web Programming with Eclipse contents
Last modified March 04, 2010 02:29 am

back next

Web Services (continued)


(1) Handling Failures

The code presented in this chapter does not handle failures. For example, if the publisher application is not running, the wiki application will not be able to publish or unpublish news items. As presented, the code will in this case throw an exception, which gets reported to the user.

Modify the publish and unpublish servlets to gracefully handle the case that the publisher application is either not running or is not reachable. In other words, instead of displaying the exception, display a message to the user that the service is currently not available and to try again later.

(2) News Item Quotas

Modify the publisher application so that it limits the maximum number of news items that can be published by a given user. If a web service client (identified by an access key) tries to publish too many news items, inform the client that the news item failed to be created because the limit has been reached.

Modify the wiki application so that it reports failures to add news items because the quota has been reached.

back next

Copyright 2007-2009 David Turner and Jinseok Chae. All rights reserved.