Netbeans Tomcat服务器实例配置
1。在netbeans-tools-server manerger下添加tomcat服务器, 默认是已经配置好的。
配置用户:这个要在base directory 下的tomcat-users.xml文件中设置
用户角色(role):admin 或者 manager 或者 admin,manager
Home Directory.服务器所在目录, 安装好以后基本不管它的事了
Base Directory: 用户配置所在目录, 设置你的服务器和你的servlets
2。发布servlet
新建一个工程, samples下有tomcat servlet example.命名为TomcatServletExample
在base directory下有apache-tomcat-5.5.17_base\work\Catalina\localhost\servlets-examples\tldCache.ser
在apache-tomcat-5.5.17_base\conf\Catalina\localhost下有depth#examples.xml:
这是以文件夹和文件形式发布的结构。前面提到的servlets-examples.xml文件中的docBase属性就是我工程文件的目录, path是制定的访问路径, 比如,我这里可以通过http://localhost:8084/servlets-examples/访问, 客户端的访问就是通过这个文件来转向的
docBase的典型结构是:
*.html, *.jsp, etc :页面
/WEB-INF/web.xml :he Web Application Deployment Descriptor for your application. This is an XML file describing the servlets and other components that make up your application, along with any initialization parameters and container-managed security constraints that you want the server to enforce for you.
/WEB-INF/classes/ :编译后的.class文件
/W