tags:

views:

44

answers:

1

Why i have an error in my web.xml when i want add servlet..?

   <servlet>
    <servlet-name>ClientServlet</servlet-name>
    <servlet-class>org.task.ClientServlet</servlet-class>
    <servlet-name>FactoryServlet</servlet-name>
    <servlet-class>org.task.FactoryServlet</servlet-class>
    <servlet-name>TraderServlet</servlet-name>
    <servlet-class>org.task.TraderServlet</servlet-class>
   </servlet>
    <servlet-mapping>
    <servlet-name>ClientServlet</servlet-name>
    <url-pattern>/ClientServlet</url-pattern>
    <servlet-name>FactoryServlet</servlet-name>
    <url-pattern>/FactoryServlet</url-pattern>
        <servlet-name>TraderServlet</servlet-name>
    <url-pattern>/TraderServlet</url-pattern>
  </servlet-mapping>
+3  A: 

Because the structure is invalid. You want something like this:

<servlet>
    <servlet-name>ClientServlet</servlet-name>
    <servlet-class>org.task.ClientServlet</servlet-class>
</servlet>

<servlet>
    <servlet-name>FactoryServlet</servlet-name>
    <servlet-class>org.task.FactoryServlet</servlet-class>
</servlet>

<servlet>
    <servlet-name>TraderServlet</servlet-name>
    <servlet-class>org.task.TraderServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>ClientServlet</servlet-name>
    <url-pattern>/ClientServlet</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>FactoryServlet</servlet-name>
    <url-pattern>/FactoryServlet</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>TraderServlet</servlet-name>
    <url-pattern>/TraderServlet</url-pattern>
</servlet-mapping>
skaffman