wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: Error handling in IResource implementations?
Date Wed, 02 Apr 2014 13:34:48 GMT
Hi,

It is not mandatory to make the second call to the WS in #writeData().
You can make it earlier, as with the metadata.
This way you can use response#setError() if needed.

Martin Grigorov
Wicket Training and Consulting


On Wed, Apr 2, 2014 at 3:25 PM, Stefan Renz <s.renz@efonds.com> wrote:

> Hi,
>
> I'm currently at loss: what would be the correct way signalling that a
> IResource implementation encountered an error?
>
> Here's the case:
>
> I have a custom AbstractResource implementation that grabs an object
> from a WebService. Getting information about the object (metadata and
> ID) is one call, actually getting the content stream by ID is another.
>
> In
> org.apache.wicket.request.resource.AbstractResource#newResourceResponse
> I get the metadata, and set the response properties accordingly (time of
> last modification, content type, etc.).
>
> Then, in the anonymous
>
> org.apache.wicket.request.resource.AbstractResource.WriteCallback#writeData()
> I make the call to retrieve the content. And here's the problem:
>
> What can I do at this stage to inform the user a problem occured, i.e.
> by forwarding to an error page (using IExceptionMapper)? Here, the
> metadata is still present (database), whereas the file content
> (filesystem) is gone for whatever reason.
>
> Thanks for your help,
> bye
>     Stefan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message