Package io.undertow.server.handlers.form

Examples of io.undertow.server.handlers.form.FormDataParser.parseBlocking()


            String mimeType = exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE);
            if (mimeType != null && mimeType.startsWith(MultiPartParserDefinition.MULTIPART_FORM_DATA)) {
                final ManagedServlet originalServlet = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getOriginalServletPathMatch().getServletChain().getManagedServlet();
                final FormDataParser parser = originalServlet.getFormParserFactory().createParser(exchange);
                if(parser != null) {
                    final FormData value = parser.parseBlocking();
                    for (final String namedPart : value) {
                        for (FormData.FormValue part : value.get(namedPart)) {
                            parts.add(new PartImpl(namedPart, part, requestContext.getOriginalServletPathMatch().getServletChain().getManagedServlet().getServletInfo().getMultipartConfig(), servletContext));
                        }
                    }
View Full Code Here


            final FormDataParser parser = originalServlet.getFormParserFactory().createParser(exchange);
            if (parser == null) {
                return null;
            }
            try {
                return parsedFormData = parser.parseBlocking();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return parsedFormData;
View Full Code Here

            final FormDataParser parser = originalServlet.getFormParserFactory().createParser(exchange);
            if (parser == null) {
                return null;
            }
            try {
                return parsedFormData = parser.parseBlocking();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return parsedFormData;
View Full Code Here

     * @throws IOException
     */
    RequestData parseFormData(final HttpServerExchange exchange) throws IOException {
        // Read post parameters
        final FormDataParser parser = parserFactory.createParser(exchange);
        final FormData formData = parser.parseBlocking();
        final RequestData data = new RequestData();
        final Iterator<String> i = formData.iterator();
        while (i.hasNext()) {
            final String name = i.next();
            final HttpString key = new HttpString(name);
View Full Code Here

            // TODO - May need a better error signaling mechanism here to prevent repeated attempts.
            return AuthenticationMechanismOutcome.NOT_AUTHENTICATED;
        }

        try {
            final FormData data = parser.parseBlocking();
            final FormData.FormValue jUsername = data.getFirst("j_username");
            final FormData.FormValue jPassword = data.getFirst("j_password");
            if (jUsername == null || jPassword == null) {
                UndertowLogger.REQUEST_LOGGER.debug("Could not authenticate as username or password was not present in the posted result");
                return AuthenticationMechanismOutcome.NOT_AUTHENTICATED;
View Full Code Here

    private Map<String, String[]> readPostParameters(HttpServerExchange exchange) throws IOException {
        final Map<String, String[]> ret = new HashMap<>();
        FormDataParser parser = FormParserFactory.builder(false).addParser(new FormEncodedDataDefinition().setForceCreation(true)).build().createParser(exchange);

        FormData formData = parser.parseBlocking();
        Iterator<String> it = formData.iterator();
        while (it.hasNext()) {
            final String name = it.next();
            Deque<FormData.FormValue> val = formData.get(name);
            if (ret.containsKey(name)) {
View Full Code Here

            if (parser == null) {
                return null;
            }
            readStarted = true;
            try {
                return parsedFormData = parser.parseBlocking();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return parsedFormData;
View Full Code Here

            final FormDataParser parser = originalServlet.getFormParserFactory().createParser(exchange);
            if (parser == null) {
                return null;
            }
            try {
                return parsedFormData = parser.parseBlocking();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return parsedFormData;
View Full Code Here

            // TODO - May need a better error signaling mechanism here to prevent repeated attempts.
            return AuthenticationMechanismOutcome.NOT_AUTHENTICATED;
        }

        try {
            final FormData data = parser.parseBlocking();
            final FormData.FormValue jUsername = data.getFirst("j_username");
            final FormData.FormValue jPassword = data.getFirst("j_password");
            if (jUsername == null || jPassword == null) {
                UndertowLogger.REQUEST_LOGGER.debug("Could not authenticate as username or password was not present in the posted result");
                return AuthenticationMechanismOutcome.NOT_AUTHENTICATED;
View Full Code Here

            // TODO - May need a better error signaling mechanism here to prevent repeated attempts.
            return AuthenticationMechanismOutcome.NOT_AUTHENTICATED;
        }

        try {
            final FormData data = parser.parseBlocking();
            final FormData.FormValue jUsername = data.getFirst("j_username");
            final FormData.FormValue jPassword = data.getFirst("j_password");
            if (jUsername == null || jPassword == null) {
                UndertowLogger.REQUEST_LOGGER.debug("Could not authenticate as username or password was not present in the posted result");
                return AuthenticationMechanismOutcome.NOT_AUTHENTICATED;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.