Can't enable Jsonp in Geoserver 2.7.0 and then publishing my WFS request in Leaflet

I'm working on localhost:8080 and want to get WFS data in a Leaflet map. So, I've read in some posts here that I first I have to enable Jsonp in my web.xml file in Geoserver. So I put


But I can't see that Jsonp is allowed with a getCapabilities :

  text/xml; subtype=gml/3.2 GML2 KML SHAPE-ZIP application/gml+xml; version=3.2 application/json application/ xml application/ application/x-gpkg csv geopackage geopkg gml3 gml32 gpkg json text/xml; subtype=gml/2.1.2 text/xml; subtype=gml/3.1.1

Then, I tried to load my WFS data into a GeoJson layer in leaflet with this code :

     Test WFS      

And firefox's console return

SyntaxError: missing ; before statement ows:1:7

Is someone knows why it doesn't work ?

Have you restartet Tomcat / Geoserver after editing the web.xml?

Your capabilities should show this entry:


Your javascript-code seems ok. --> slightly adapted with an other Geoserver/Layer here:

Watch the video: Publishing WMS and WFS with GeoServer and Leaflet (October 2021).