in general:
Is it possible to differently style some of the wms features from a single wms query based on the cql filter, or other parameter?
in particular:
on a wms query, returning the raster of a collection of features (i.e. points styled as red dots),
i wish geoserver to differrently style (blue dot) just one particular feature identified by a http-req-parameter sent with the wms request
keeping the others in the collection with default style
and avoiding an overlap of two wms:
A quicker (and probably easier) way than @Fmba's suggestion is to request the layer twice, once with the default color and a second time with a filter and a highlight style. You could either do this in one request or make two requests so that the browser can cache the default layer and only refetch the highlights.
For the first request it would look something like:
http://....../wms?service=wms&.....&layers=dots,dots&styles=,highlight&cql_filter=INCLUDE;INTERSECT(the_geom,%20POINT%20(-74.817265%2040.5296504))
This requests the layer (dots) twice, once with the default style (or you could use a named style here too) and then with the highlight style. Finally you must supply two filters (the first is just true to return everything).
while in the second you would just add another layer as usual.