Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can have the two servlets with same URL pattern?

 
ramakrishna rayudu
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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...
 
sudhir nim
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
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like originally said: no.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic