关于servlet和struts的配置问题自己想法

来源:百度文库 编辑:神马文学网 时间:2024/04/25 16:52:22
学习过struts之后突然又去看了servlet,就对web.xml里边的配置很不理解。自己想想之后感觉这样解释比较好。
servlet配置:

This is the description of my J2EE component
This is the display name of my J2EE component
ManageUserServlet
com.xxf.servlet.ManageUserServlet


ManageUserServlet
/servlet/ManageUserServlet

解释为:tomcat环境会去调用servlet环境里的东东,这里不用说是直接的指定另一个页面。意思是servlet自动的从servlet环境下拿出你部署上来的请求



struts配置:有两个,一个是web.xml配置,一个是struts.xml配置
首先还是tomcat-->服务器-->web.xml找到struts配置的过滤器,然后进入struts.xml配置文件找到它要去的页面。
在web.xml下配置

struts2

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter



struts2
/*

在struts下配置



/hello.jsp