wink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryant Luk <>
Subject Re: Result paging
Date Tue, 01 Jun 2010 15:49:39 GMT
I think what is popular is to emulate what public applications are
doing, namely the query parameter approach with cursor offsets.  I
know that goes against what the stackoverflow question is asking for
but it's more for practicality.

First, it's a defacto standard.   Services like Google, Yahoo, Bing,
Twitter, etc. all use some sort of query parameter(s).  So developers
understand it and can easily use it.

Second, it's addressable by almost everything from regular browsers to
curl.  User agents should be able to easily add query parameters to
the URL request.  Depending if your service has the requirement or
not, "regular users" can copy and paste the URL and give it to someone
to use.  While I think the world would be a better place if we used
the full capabilities of the HTTP spec, the reality is that if you
want your service to be used by regular people you have to follow
their habits.

Third, it is easily hyperlinked within other documents.  Many response
entity formats have a concept of including hyperlinks to other
resources.  A URL is usually the only means of including that
information easily.  For instance, in your "default page 1" document,
you can have a hyperlink to the next page.  This can help you shape
requests in a dynamic fashion.

A couple of interesting things mentioned in the StackOverflow discussion:
-  IMO, Custom error codes aren't really useful in practice unless you
control every client interacting with your service.
-  I believe the 413 - Request Entity Too Large status code is more
for the request entity being too large (and not necessarily the
response).  (i.e. you send 5GB of a binary file to your server and
your server can't handle that).

As far as Wink approaches here, I think it's more in the actual
application layer rather than the Wink layer that the real work needs
to be done.  It's really up to application developers to process
queries (@QueryParam()) or request headers here (@Context HttpHeaders)
and/or return the right amount of content back with the right page

What do you think?

On Tue, Jun 1, 2010 at 2:05 AM, Michael Zehrer <> wrote:
> Hi fellow winkers,
> I'm thinking about result paging in my Wink application. There is an
> interesting discussion at Stackoverflow [] which
> explores "standard conform" solutions for this. What's Winks approach to
> result paging?
> Best, Michael

View raw message