Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two servlets with same URL?

 
anish manikandan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I wanted to know if this crazy idea would work.

I have a servlet which acts as an entry point to my web service which is coded in Java completely. Now, I want to change the same web service to AXIS. I don't want to change the URL for it on my web server. And I want to deploy both of them at the same time, and route requests to the corresponding service depending on the requests.

I hope now you believe I'm crazy.

I want to know if there is a way I can implement this.

Thanks,
Anish
[ May 08, 2008: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and route requests to the corresponding service depending on the requests.
If the URL for the requests are identical, on what basis would you propose determine which to activate?
 
Dan Walin
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would think if there was a parameter in the URL that indicated which web service to call, the servlet could read the parameter and call the correct web service based on that.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dan Walin:
I would think if there was a parameter in the URL that indicated which web service to call ...
But then, of course, it's no longer the same URL.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If all requests came first to a filer, you could use something in the request headers to decide which servlet to call. For example you could have different servlets for different Accept-* headers.

In the Jersey project for RESTful web services the container can direct requests according to the Accept media type. So if the request type was for XML it could go to the new AXIS based servlet.

Bill
[ May 09, 2008: Message edited by: William Brogden ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic