我在classes先新建了个目录xnservlet,把编译好的servlet放进去了,运行的时候报错呀。
web.xml里也指定了,这是为什么?
但如果我把这个servlet放到classes下就是好的,帮帮忙呀!<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"><web-app>
    <servlet>
        <servlet-name>
            Fy
        </servlet-name>
        <servlet-class>
            Fy
        </servlet-class>
    </servlet>
     <servlet-mapping>
        <servlet-name>
            Fy
        </servlet-name>
        <url-pattern>
            /xnservlet/Fy
        </url-pattern>
    </servlet-mapping> 
    <taglib>
        <taglib-uri>
   http://java.apache.org/tomcat/examples-taglib
        </taglib-uri>
        <taglib-location>
           /WEB-INF/jsp/example-taglib.tld
        </taglib-location>
    </taglib>    <security-constraint>
      <web-resource-collection>
         <web-resource-name>Protected Area</web-resource-name>
 <!-- Define the context-relative URL(s) to be protected -->
         <url-pattern>/jsp/security/protected/*</url-pattern>
 <!-- If you list http methods, only those methods are protected -->
 <http-method>DELETE</http-method>
         <http-method>GET</http-method>
         <http-method>POST</http-method>
 <http-method>PUT</http-method>
      </web-resource-collection>
      <auth-constraint>
         <!-- Anyone with one of the listed roles may access this area -->
         <role-name>tomcat</role-name>
 <role-name>role1</role-name>
      </auth-constraint>
    </security-constraint>
</web-app>