.
I solved it with a additional variable "wmsurl" in the jsp:
dojo.declare("my.WMS1Layer", esri.layers.DynamicMapServiceLayer, {
wmsurl: "string",
constructor: function() {
this.initialExtent = this.fullExtent = new esri.geometry.Extent(2490000,5576100,2738000,5826000,new esri.SpatialReference({"wkid":31466}));
this.spatialReference = new esri.SpatialReference({wkid:31466});
this.loaded = true;
this.onLoad(this);
},
getImageUrl: function(extent, width, height, callback) {
var params = {
...
};
callback("YOUR_URL?" + dojo.objectToQuery(params));
this.wmsurl = ("YOUR_URL?" + dojo.objectToQuery(params));
}
})
Now I can access the url by layer.wmsurl in MapPrinter.js
And the WMS content is being displayed in the pdf!
I made lot's too many thoughts for a simple solution.