Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package io.undertow.attribute;
 
The query string

Author(s):
Stuart Douglas
 
public class QueryStringAttribute implements ExchangeAttribute {
    public static final String QUERY_STRING_SHORT = "%q";
    public static final String QUERY_STRING = "%{QUERY_STRING}";
    public static final ExchangeAttribute INSTANCE = new QueryStringAttribute();
    private QueryStringAttribute() {
    }
    @Override
    public String readAttribute(final HttpServerExchange exchange) {
        return exchange.getQueryString();
    }
    @Override
    public void writeAttribute(final HttpServerExchange exchangefinal String newValuethrows ReadOnlyAttributeException {
        exchange.setQueryString(newValue);
    }
    public static final class Builder implements ExchangeAttributeBuilder {
        @Override
        public String name() {
            return "Query String";
        }
        @Override
        public ExchangeAttribute build(final String token) {
            if (token.equals() || token.equals()) {
                return .;
            }
            return null;
        }
    }
New to GrepCode? Check out our FAQ X