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

Servlet mapping

 
Singh Kuldeep
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have two servlets in same pakage "myServlets" , 'first' and 'second'.

Now i want to access these servlet from different pages like from A.jsp and B.jsp.
in web.xml i mapped them as <servlet-mapping><servlet-name>s1</servlet-name><url-pattern>/</url-pattern></servlet-mapping>
<servlet-mapping><servlet-name>s2</servlet-name><url-pattern>/</url-pattern></servlet-mapping>

=========
admin/A.jsp
<form action="s1">
===========
employee/B.jsp
<form action="s2">


but when i run either page, same servlet is executed. Can some body please tell me where i am doing wrong.
 
J. Kevin Robbins
Bartender
Pie
Posts: 1801
28
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a closer look at your URL Patterns in the web.xml. See anything odd there?
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What behavior do you expect by mapping the URL pattern / to both the servlets?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic