Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #20816

Re: POSTing to a servlet

From Lothar Kimmeringer <news200709@kimmeringer.de>
Newsgroups comp.lang.java.programmer
Subject Re: POSTing to a servlet
Date 2012-12-30 14:47 +0100
Organization Organization?! Only chaos here!
Message-ID <fxzo0zi1mxg0.dlg@kimmeringer.de> (permalink)
References <e3d17f12-5b5f-4655-a596-402d66bcbf82@googlegroups.com>

Show all headers | View raw


RVic wrote:

> I have a JUnit test that tests a servlet. The code is straightforward:
> 
> HttpClient httpClient = new DefaultHttpClient();
> List<NameValuePair> nvps = new ArrayList<NameValuePair>();
> HttpPost httpPost = new HttpPost("http://myaerver.com:8080/servlets/json");

[...]

> On this last line however, httpClient.execute(), things fail and I am at an utter loss as to why. The URL is good. Examination of the stack shows:
> 
> org.apache.http.client.HttpResponseException: Moved Temporarily
[...]
> "Moved Temporarily?" What in the world might be going on here? TIA

Try
HttpPost httpPost = new HttpPost("http://myaerver.com:8080/servlets/json/");
instead.


Regards, Lothar
-- 
Lothar Kimmeringer                E-Mail: spamfang@kimmeringer.de
               PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
                 questions!

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

POSTing to a servlet RVic <rvince99@hotmail.com> - 2012-12-13 05:59 -0800
  Re: POSTing to a servlet Arne Vajhøj <arne@vajhoej.dk> - 2012-12-13 19:50 -0500
  Re: POSTing to a servlet Roedy Green <see_website@mindprod.com.invalid> - 2012-12-17 02:46 -0800
  Re: POSTing to a servlet Lothar Kimmeringer <news200709@kimmeringer.de> - 2012-12-30 14:47 +0100
    Re: POSTing to a servlet Arne Vajhøj <arne@vajhoej.dk> - 2012-12-30 15:37 -0500

csiph-web