This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes get parameter from ApacheHttpClient in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "get parameter from ApacheHttpClient in servlet" Watch "get parameter from ApacheHttpClient in servlet" New topic
Author

get parameter from ApacheHttpClient in servlet

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi Folks,

I am calling a servlet from a simple java class using ApacheHttpClient. and also i am setting an Object



now i want to get the DTO objcet in servlet .
i tried like this but it returns null. please correct me
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I think you're confused about how web apps work: only strings are passed between the server and the client.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Ok. Thank you for the Clarification
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43929
    
  33
I know it's late, but I think this thread would sit better on our Sevlets forum.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 607

I don't understand why the code compiles in the first place.

The setParameter has setParameter(String parameterName, String parameterValue) -- however it belong to the PostMethod
class. getParams() returns a HttpMethodParams which does not have any method called as setParameter().

Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: get parameter from ApacheHttpClient in servlet
 
It's not a secret anymore!