• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSON and multiple Servlets  RSS feed

 
Vishal Biyani
Greenhorn
Posts: 3
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing a GWT+Google DataStore app which will use JSON as data exchange format. There are multiple calls/operations which client will invoke to server. My query is, if I have to write to Servlets which return JSON data, so

1) A single servlet serves all requests. Server will recognize which function to be called based on some flag passed as part of request
2) For each and every such operation I write a seperate servlet

Any other/better options?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd probably break it down by domain rather than by function. So if I had User operations, I'd use a UserServlet and if I had Product operations, I might utilize a ProductServlet.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!