• 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

deployment descriptor contents in servlet?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to ask  general question regarding deployment descriptor (web.xml) file?
Can we specify communication endpoint in this file ?
for example I m using HTTPUrlConnection class in Servlet1. This Servlet1 then send GET reqest to Servlet2 which is running in VM and which processes the requst and prints something. By communication endpoint i mean the URL of Servlet2 which i have to specify in Servlet1 code. I want to access this URL somehow from web.xml of Servlet1. So in cases when Servlet2 moves to some other URL, i dont have to modify the Servlet1 code but web.xml of Servlet1.

Also can we specify somehow which HTTP methods are being used in which servlet by web.xml?
 
Sheriff
Posts: 67746
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
I believe what you are looking for are initialization parameters or context parameters.
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Also can we specify somehow which HTTP methods are being used in which servlet by web.xml?


No, that depends on the method being passed by the client request (and, obviously, by which doXYZ methods are implemented by the servlet). But as per the HTTP specification, methods shouldn't be used interchangeably, as they serve different purposes. So it's not clear what would be gained from determining this dynamically.
reply
    Bookmark Topic Watch Topic
  • New Topic