File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Other Open Source Projects
getParameter in jsp file sent by HttpClient
Joined: May 19, 2012
Jun 26, 2012 13:58:32
I am sending a http post request from
. Here is the code:
HttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost( "http://alexgifei.s156.eatj.com/index.jsp"); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("message", "123")); httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); httpClient.execute(httpPost);
and in the jsp file i try to display the message
but i get null:
<% String message=request.getParameter("message"); %> message <%=message%><br/>
Life is not measured by the number of breaths we take, but by the moments that take our breath away.
Author and ninkuma
Joined: Jan 10, 2002
Jun 26, 2012 14:01:33
You did not mention that this is an HttpClient question in your subject. That's important so I added it.
Aside from your question, you should not be using Java scriptlets in JSPs written after 2002. That's 10 years ago. Please read
this JspFaq entry
Asking smart questions
Books by Bear
I agree. Here's the link:
subject: getParameter in jsp file sent by HttpClient
Creating HTTP Post
How to post data from android app to php page
Ajax and post messages
Post the data to Server
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014