code: public static Filter getBboxFilter( String attribute, double west, double east, double south, double north )
              throws CQLException {
  
          if (attribute == null) {
              attribute = "the_geom";
          }
  
          StringBuilder sB = new StringBuilder();
          sB.append("BBOX(");
          sB.append(attribute);
          sB.append(",");
          sB.append(west);
          sB.append(",");
          sB.append(south);
          sB.append(",");
          sB.append(east);
          sB.append(",");
          sB.append(north);
          sB.append(")");
  
          Filter bboxFilter = CQL.toFilter(sB.toString());
  
          return bboxFilter;
      }
docs: Create a bounding box filter from the bounds coordinates.
  
  @param attribute the geometry attribute or null in the case of default "the_geom".
  @param west western bound coordinate.
  @param east eastern bound coordinate.
  @param south southern bound coordinate.
  @param north northern bound coordinate.
  @return the filter.
  @throws CQLException