vaadin / framework

Vaadin 6, 7, 8 is a Java framework for modern Java web applications.
http://vaadin.com/
Other
1.77k stars 729 forks source link

The Same order in Query Parameters as in URL #12544

Open vuyko23 opened 1 year ago

vuyko23 commented 1 year ago

Hello, can you add possibility to get Query Parameters in the same order that in the URL?

TatuLund commented 1 year ago

In Vaadin 8 and 7, the VaadinRequest#getParameterMap method returns the result directly from javax.servlet.ServletRequest#getParameterMap. So Vaadin does nothing here. JavaDoc from there says, i.e. does not seem to say anything about whether order is preserved or not. So this is purely upto container implementation. The guideline is that you should not depend on order of the query parameters.

    /**
     * Returns a java.util.Map of the parameters of this request.
     * 
     * <p>Request parameters are extra information sent with the request.
     * For HTTP servlets, parameters are contained in the query string or
     * posted form data.
     *
     * @return an immutable java.util.Map containing parameter names as 
     * keys and parameter values as map values. The keys in the parameter
     * map are of type String. The values in the parameter map are of type
     * String array.
     */
    public Map<String, String[]> getParameterMap();