I've adapted the working example from geo-solutions website but still it is not working, it seems the problem is with jetty. below is the previous question
I'm using Geoserver with jetty web server, I've published WMS layer in GeoServer and when i call it from QGIS it works perfectly, but when i call it with OpenLayers it is not loading, it says HTTP ERROR: 404 Not found, both my html file (with the OpenLayers script) and GeoServer are running on localhost:8083.
<html>
<head>
<title>Counties of enschede</title>
<link rel="stylesheet" href="localhost:8083/www/openlayers/theme/default/style.css" type="text/css">
<style>
#map-id {
width: 512px;
height: 300px;
}
</style>
<script src="localhost:8083/www/openlayers/OpenLayers.js"></script>
</head>
<body>
<h1>Counties of enschede</h1>
<div id="map-id"></div>
<script>
var bounds = new OpenLayers.Bounds(
760709.059251067, 6834146.95621378,
775589.940002763, 6845228.94005499
);
var options = {
controls: [],
maxExtent: bounds,
maxResolution: 0.02741796875,
projection: "EPSG:3857",
units: 'm'
};
map = new OpenLayers.Map('map-id', options);
var ccounties = new OpenLayers.Layer.WMS(
"Map - Enschede", "http://localhost:8083/geoserver/thesis/wms",
{
srs: 'EPSG:3857',
layers: 'thesis:Ensche',
styles: '',
format:'image/png'
},
{singleTile: true, ratio: 1}
);
map.addLayer(ccounties);
// build up all controls
map.addControl(new OpenLayers.Control.PanZoomBar({
position: new OpenLayers.Pixel(2, 15)
}));
map.addControl(new OpenLayers.Control.Navigation());
map.addControl(new OpenLayers.Control.Scale());
map.addControl(new OpenLayers.Control.MousePosition());
map.zoomToExtent(bounds);
</script>
</body>