@RequestMapping(value = "/wms/**", method = RequestMethod.GET)
public void getWms(HttpServletRequest request, HttpServletResponse response) throws Exception {
// Search for the WMS layer:
String layerId = parseLayerId(request);
WmsLayer layer = getLayer(layerId);
if (layer == null) {
throw new LayerException(ExceptionCode.LAYER_NOT_FOUND, layerId);
}
RasterLayerInfo layerInfo = layer.getLayerInfo();
String url = layer.getBaseWmsUrl() + "?" + request.getQueryString();
InputStream stream = null;
try {
response.setContentType(layer.getFormat());
stream = httpService.getStream(url, layer.getAuthentication());
ServletOutputStream out = response.getOutputStream();
int b;
while ((b = stream.read()) >= 0 ) {
out.write(b);
}