日期:2014-05-17  浏览次数:20733 次

myeclipse6.5的servelet部署問題
不知道為什麼在Struts2中的web.xml中加入如下腳本,tomcat啟動時一直提示
ervlet mapping specifies an unknown servlet name AutoProcCompl
請教大家。。。。


<servlet>
        <servlet-name>autoProCompl</servlet-name>
        <servlet-class>com.xiali.servlet.AutoProcCompl</servlet-class>
    </servlet>

<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>
org.directwebremoting.servlet.DwrServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>classes</param-name>
<param-value>java.lang.Object</param-value>
</init-param>
<init-param>
<param-name>crossDomainSessionSecurity</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>allowScriptTagRemoting</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>100</load-on-startup>
</servlet>

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

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>

------解决方案--------------------
autoProCompl首字母大小写问题,servlet-name和映射的不一致
------解决方案--------------------
<servlet-mapping>
????????<servlet-name>action</servlet-name>
????????<url-pattern>*.do</url-pattern>
????</servlet-mapping>

你这个是干嘛的?没用的话删了啊,前面都没配
------解决方案--------------------
刚学servlet,建议楼主从tomcat里面的示例中拷一个web.xml,清干净,然后添加自己需要的配置,加深理解。