This week's book giveaway is in the JDBC and Relational Databases forum.
We're giving away four copies of Murach's MySQL and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Two servlets with same URL?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67745
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67745
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic