One example might be if the application
server shuts down in the middle of servicing a DWR request. This will result in an HTTP
error, and DWR can handle this because it can see the error code and act accordingly.
Handling Exceptions
The final category is exceptions. These are errors that occur on the server side, and which
propagate out to the client side. These are actually treated like errors when they hit the client,
but they really are conceptually a whole different category. However, they are treated like
errors even to the extent of being dealt with by the same handler, so in practice you may find
little difference.
Edge Cases: Improper Responses
There exists one other category that kind of stands on its own, but before you can understand
it you need to understand what DWR is passing back and forth between the client and server.
When a request is made, it??™s a fairly typical HTTP request. You can see what a DWR
request looks like by using the handy Firebug extension to Firefox, which results in what you
see in Figure 3-3.
As you can see, it??™s a pretty typical HTTP POST operation. You can see the two numbers I
entered being passed in, along with the name of the method being called on the remote object
(add() in this case), the name of the JavaScript object (MathDelegate), and some other information
DWR uses internally to do its work.
Pages:
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215