File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Better way to send a http response

 
Jill scott
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a servlet that responds to a request with value for 3 fields, say a="1" b="2" and c="3"

Which is the better way to send these as response? setting these as parameters in ServletRequest object or putting these values in a Serializable POJO and send it to client?

Please respond
 
AjayKumar Panigrahi
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi jill
That depends on your application.what are you interested to do with those values?
As far i am concerned, its better to set these parameters in ServletRequest if you just need to respond.And if you need to store it in the database better to go with plain old java objects.Its good architecture DAO data access object
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the client? How does it expect the information? What is it going to do with it?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic