// Path: grumpy-ogc/src/main/java/com/github/davidmoten/grumpy/wms/MissingMandatoryParameterException.java
// public class MissingMandatoryParameterException extends Exception {
// 
//     private static final long serialVersionUID = -9206288232141856630L;
// 
//     public MissingMandatoryParameterException(String parameter) {
//         super(parameter + " is a mandatory parameter and was missing");
//     }
// 
// }


import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.github.davidmoten.grumpy.wms.MissingMandatoryParameterException;
package com.github.davidmoten.util.servlet;




public class RequestUtil {

    private static final String COMMA = ",";

    public static List<String> getList(HttpServletRequest request, String parameter,
            boolean mandatory) {
        String[] items = new String[] {};
        if (request.getParameter(parameter) != null)
            items = request.getParameter(parameter).split(COMMA);
        return Arrays.asList(items);
    }

    public static String getParameter(HttpServletRequest request, String parameter,
// Path: grumpy-ogc/src/main/java/com/github/davidmoten/grumpy/wms/MissingMandatoryParameterException.java
// public class MissingMandatoryParameterException extends Exception {
// 
//     private static final long serialVersionUID = -9206288232141856630L;
// 
//     public MissingMandatoryParameterException(String parameter) {
//         super(parameter + " is a mandatory parameter and was missing");
//     }
// 
// }


// Path: grumpy-ogc/src/main/java/com/github/davidmoten/util/servlet/RequestUtil.java
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.github.davidmoten.grumpy.wms.MissingMandatoryParameterException;

package com.github.davidmoten.util.servlet;




public class RequestUtil {

    private static final String COMMA = ",";

    public static List<String> getList(HttpServletRequest request, String parameter,
            boolean mandatory) {
        String[] items = new String[] {};
        if (request.getParameter(parameter) != null)
            items = request.getParameter(parameter).split(COMMA);
        return Arrays.asList(items);
    }

    public static String getParameter(HttpServletRequest request, String parameter,
            boolean mandatory) throws MissingMandatoryParameterException {