• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

can have the two servlets with same URL pattern?

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

can i have two servlets with same URL-PATTREN???
if it possible which Servlet will be Invoke By The Container?

Thanks,
Ramakrishna Rayudu.
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
 
ramakrishna rayudu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i am trying some example with this it not giving Any error to me..??
will it give any Exception??
 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try it out and see what happens.
 
ramakrishna rayudu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.i have tryed onces

<servlet>
<servlet-name>SingleTurnServletTest</servlet-name>
<servlet-class>
com.gtm.v2.servlet.SingleTurnServletTest
</servlet-class>
</servlet>

<servlet>
<servlet-name>V2PayPalNotificationServlet</servlet-name>
<servlet-class>
com.gtm.v2.paypal.V2PayPalNotificationServlet
</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SingleTurnServletTest</servlet-name>
<url-pattern>/a</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>V2PayPalNotificationServlet</servlet-name>
<url-pattern>/a</url-pattern>
</servlet-mapping>

But all ways "V2PayPalNotificationServlet" This Servlet only executing...
 
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not have two servlets mapped to same URL pattern. If you define your URL mapping this way, the result can be unpredictable. In any situation, both of your servlets will never be executed for same request/url-pattern, So avoid it.
 
ramakrishna rayudu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankq u....
 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like originally said: no.
 
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic