Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6792E200B96 for ; Thu, 6 Oct 2016 11:38:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 66425160AED; Thu, 6 Oct 2016 09:38:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A6802160AE0 for ; Thu, 6 Oct 2016 11:38:22 +0200 (CEST) Received: (qmail 51367 invoked by uid 500); 6 Oct 2016 09:38:21 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 51132 invoked by uid 99); 6 Oct 2016 09:38:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2016 09:38:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D9F0D2C2A67 for ; Thu, 6 Oct 2016 09:38:20 +0000 (UTC) Date: Thu, 6 Oct 2016 09:38:20 +0000 (UTC) From: "Neal Hu (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-7071) HttpServletRequest.getParameter only get String from query not both posted form data MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 06 Oct 2016 09:38:23 -0000 [ https://issues.apache.org/jira/browse/CXF-7071?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D155514= 71#comment-15551471 ]=20 Neal Hu commented on CXF-7071: ------------------------------ Sergey=EF=BC=8C Have you checked in the code? If yes please let me know. :) > HttpServletRequest.getParameter only get String from query not both poste= d form data > -------------------------------------------------------------------------= ----------- > > Key: CXF-7071 > URL: https://issues.apache.org/jira/browse/CXF-7071 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 3.1.7 > Reporter: Neal Hu > Assignee: Sergey Beryozkin > Fix For: 3.2.0, 3.1.8, 3.0.11 > > > The http request: > POST /dubbott-demo-provider/v1.0/users/beanparam HTTP/1.1 > HOST: localhost:8080 > accept: text/plain > content-type: application/x-www-form-urlencoded > content-length: 12 > pageIndex=3D99 > The resource method returns null: > {code:java} > public String beanParam(@Context HttpServletRequest req, String ak) { > String pageIndex =3D req.getParameter("pageIndex") =20 > return pageIndex; > } > {code} > From the servlet 3.1 API doc: > String javax.servlet.ServletRequest.getParameter(String name) > Returns the value of a request parameter as a String, or null if the para= meter does not exist. Request parameters are extra information sent with th= e request. For HTTP servlets, parameters are contained in the query string = or posted form data. > if we add below servlet filter: > {code:java} > =09public void doFilter(ServletRequest request, ServletResponse response,= FilterChain chain) throws IOException, ServletException { > =09 System.out.println(request.getParameter("pageIndex") ); > =09=09chain.doFilter(request, response); > =09} > {code} > The output is "99" the response is the same "99". > As a conclusion the CXF HttpServletRequest doesn't comply the Servlet 3.1= API Spec. -- This message was sent by Atlassian JIRA (v6.3.4#6332)