Win a copy of Head First Android this week in the Android 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

can have the two servlets with same URL pattern?

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67595
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
No.
 
ramakrishna rayudu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67595
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
Try it out and see what happens.
 
ramakrishna rayudu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thankq u....
 
Bear Bibeault
Sheriff
Posts: 67595
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
Like originally said: no.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic