From users-return-264569-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Wed Apr 25 14:38:45 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 42D63180676 for ; Wed, 25 Apr 2018 14:38:45 +0200 (CEST) Received: (qmail 44055 invoked by uid 500); 25 Apr 2018 12:38:43 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 44042 invoked by uid 99); 25 Apr 2018 12:38:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2018 12:38:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id EF57B1A2421 for ; Wed, 25 Apr 2018 12:38:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.899 X-Spam-Level: *** X-Spam-Status: No, score=3.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_BADIPHTTP=2, KAM_SHORT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id tuqEPl5oavaa for ; Wed, 25 Apr 2018 12:38:41 +0000 (UTC) Received: from mail-yb0-f175.google.com (mail-yb0-f175.google.com [209.85.213.175]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id BAE9B5F189 for ; Wed, 25 Apr 2018 12:38:40 +0000 (UTC) Received: by mail-yb0-f175.google.com with SMTP id i13-v6so8203473ybl.4 for ; Wed, 25 Apr 2018 05:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=/rELeFbnqclQx6pM8pWSPm72XeQmfAaQMV/tOmMaLKA=; b=WLYh79rah/hq0Wz9iPgD04F7Lk0wlGskAbXCoTGVAs71/k19HSt75Ydp+y+4dp9MPj o7rCAR420U1ICBWal01NDC2jFQWjkhbKzFZ5fJI/F4MnR7dJh6VLFC2UjINuDqcJX5z6 5WpIIrWTlw/Yk8nYyjQX9ztziNUATBGs9FLCYt9KupEODds5JTJNB65JGAvFTReJFkTW pbQNMBqIRMuvF1D3iDcjGF1IECVxmhRKq4YqVtoNMsdGloDVN4HC7nscY1pEaj9n59Y+ wZk+iiA616nu73L+apbMryev5GGDk0G11CTke3+W60Phn1gehCP1HEaomDCmCaKpu1jY k6oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=/rELeFbnqclQx6pM8pWSPm72XeQmfAaQMV/tOmMaLKA=; b=CTMPPw6a0Kkc+ABCQF2Y2kWzPQbbFDqXSJjzAXErO0fpNd+q4IqffeRfmx5bSQaqHx yHnVKiikPSeOm5lUz52trKxxTYniP0imvgqNHJ/Nz6Mz1mtGf0Zg1cVbLYwV9joqORuv sfjKx5p3R9uWR65cFmyRtRaF4IpohKEPnVb3T0pYJOoirbGxQPrLtZqJCNx2+KT0dvHC oz1pZEpC+ihcvxymfWqHicHjJJT26m7sQi91D+1kovthBNufI51Jx1V3q8v++Iqk3zBJ Ch02HmnarjTwswb0hRUil+MIY5Nup7SLfQurnH59qwSYH2oMmXrjGAUx+8Y3jJrNyMPg Wkyg== X-Gm-Message-State: ALQs6tAUJ1ODE7bNunZ7prdAiOMAQSkCbbTciHoYJq/nnqssT60brdPR l1DwMgJbnzZq6bQt+FArjL58JYGfpWNMlN29xws= X-Google-Smtp-Source: AB8JxZo4pc1JeY2WEMDCmJojbWH5gplRHFULYAK9Q5gkp2SozVmgIhJ35/Bce3Nm12px4oS9lEitLTakieKw52qMMzI= X-Received: by 2002:a25:bd0d:: with SMTP id f13-v6mr2411080ybk.284.1524659913013; Wed, 25 Apr 2018 05:38:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.226.194 with HTTP; Wed, 25 Apr 2018 05:38:32 -0700 (PDT) In-Reply-To: <582fdd89153849f1a92f5f87a9b61ec5@ktblexchange.ktbl.local> References: <582fdd89153849f1a92f5f87a9b61ec5@ktblexchange.ktbl.local> From: Zahi Fail Date: Wed, 25 Apr 2018 15:38:32 +0300 Message-ID: Subject: Re: [eX-Bulk]: Error while sending ajax post request to my tomcat web app To: Tomcat Users List Content-Type: multipart/alternative; boundary="00000000000084c017056aab8c52" --00000000000084c017056aab8c52 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It seem to be a CROS issue, thanks for your advice. Although, after i reconfigured my tomcat service.xml, i still get the some message as above. any advices of how to change my JQuery request? Thanks. On Wed, Apr 25, 2018 at 2:06 PM, Mario Schmitz wrote: > Hey, > > seems u have a problem with CORS > > https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS > > cheers > > -----Urspr=C3=BCngliche Nachricht----- > Von: Zahi Fail [mailto:zahi.fail@gmail.com] > Gesendet: Mittwoch, 25. April 2018 12:53 > An: Tomcat Users List > Betreff: [eX-Bulk]: Error while sending ajax post request to my tomcat we= b > app > > Hello, > > I'm working with Tomcat 9.0.6 version as my servlet, I have tested my web > service with postman and it seems to work fine. > > While i tried to send simple ajax that i have build and tested in chrome, > i got an error. > > *the request is :* > > function setAllTlcsStatus() { > var tlc =3D [{"id":1, "code":2, "time":"2009-02-15", "cycleSecond":22, > "programNumber":1221, "stageNumber":22, "moves":"22", "detectors":"fead",= " > conditions":"2ddsa"}; > data.push(tlc); > $.ajax({ > type: 'POST', > url: "http://127.0.0.1:8080/userManagement/rest/Traffic/users2", > dataType: 'json', > contentType: 'application/json', > data: JSON.stringify(tlc), > success: function( data, textStatus, jQxhr ){ > alert("good"); > }, > error: function( jqXhr, textStatus, errorThrown ){ > alert("Not good"); > console.log( errorThrown ); > } > }); > } > > > *and the error i got: * > > *Failed to load http://127.0.0.1:8080/userManagement/rest/Traffic/users2 > : Response to > preflight request doesn't pass access control check: No > 'Access-Control-Allow-Origin' header is present on the requested resource= . > Origin 'null' is therefore not allowed access.* > --00000000000084c017056aab8c52--