I had a look at a couple other implementations. Is there a better way then
thread local to get access to the Request (and specifically the request
getKvp() method) ?

Jody Garnett


On Sat, Jan 25, 2014 at 3:26 AM, Justin Deoliveira <notifications@github.com
> wrote:

> In
> src/wfs/src/main/java/org/geoserver/wfs/json/GeoJSONGetFeatureResponse.java:
>
> > @@ -103,6 +106,14 @@ protected void write(FeatureCollectionResponse featureCollection, OutputStream o
> >          // Generate bounds for every feature?
> >          WFSInfo wfs = getInfo();
> >          boolean featureBounding = wfs.isFeatureBounding();
> > +
> > +        // include fid?
> > +        String id_option = null; // null - default, "" - none, or "property"
> > +        Request request = Dispatcher.REQUEST.get();
> > +        if (request != null) {
> > +            id_option = JSONType.getIdPolicy( request.getKvp() );
> > +        }
> > +
>
> Do you need to use the thread local for this? Can't you pull the format
> option from the request option. And this should be specified as a format
> option rather than an additional top level kvp paramter.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/geoserver/geoserver/pull/468/files#r9153700>
> .
>