These vendor parameters need to be sent to geoserver from OpenLayers. hence the parameter needs to be put in the options of the constructor of your layer.
So the simple way of constructing our layer is like this:
var wms = new OpenLayers.Layer.WMS("My Layer",
"http://example.com/geoserver/wms",
{layers: "states"});
To pass on vendor parameters to the server, you'll need to do this:
var wms = new OpenLayers.Layer.WMS("My Layer",
"http://example.com/geoserver/wms",
{
layers: "states",
transparent: true, //standard WMS parameter
angle: 45, //vendor specific parameter
buffer:5 //vendor specific parameter
});
These vendor specific parameters will be appended to the WMS requests that OpenLayers makes, and hence Geoserver will respond with an appropriate response.