servlet和tomcat的知识点有哪些

这篇“servlet和tomcat的知识点有哪些”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“servlet和tomcat的知识点有哪些”文章吧。

servlet是什么
为了能让web服务器与web应用这两个不同的软件系统协作,需要一套标准接口,servlet就是其中最主要的一个接口。

规定:

web服务器可以访问任意一个web应用中实现servlet接口的类。

web应用中用于被web服务器动态调用的程序代码位于servlet接口的实现类中。

sun公司(现在被oracle收购了……)制定了web应用于web服务器进行协作的一系列标准java接口(统称为java servlet api)。

sun公司还对web服务器发布及运行web应用的一些细节做了规约。sun公司把这一系列标准java接口和规约统称为servlet规范。

servlet是一种运行在服务器上的小插件。

servlet容器是什么

在servlet规范中,把能够发布和运行javaweb应用的web服务器称为servlet容器,他的最主要特称是动态执行javaweb应用中的servlet实现类中的程序代码。

tomcat是什么

tomcat是servlet容器,同时也是轻量级的web服务器。

apache server、microsoft iis、apache tomcat都是web服务器。

tomcat作为web服务器时,主要负责实现http传输等工作。

tomcat作为servlet容器时,主要负责解析request,生成servletrequest、servletresponse,将其传给相应的servlet(调用service( )方法),再将servlet的相应结果返回。

tomcat组成结构

servlet和tomcat的知识点有哪些

server,代表整个servlet容器组件,是tomcat的顶层元素。其中可以包含一到多个service;

service,包含一个engine,以及一到多个connector;

connector,代表和客户端程序实际交互的组件,负责接收客户请求,以及向客户返回响应结果;

engine,处理同一个service中所有connector接收到的客户请求;

host,在engine中可以包含多个host,每个host定义了一个虚拟主机,它可以包含一个到多个web应用;

context,一个host中可以包含多个context,每个context代表了运行在虚拟主机上的单个web应用。

这些字段都在conf/server.xml中配置,下面是一段apache tomcat 6.0.36默认的server.xml:

<?xml version='1.0' encoding='utf-8'?> 
<!-- 
 licensed to the apache software foundation (asf) under one or more 
 contributor license agreements. see the notice file distributed with 
 this work for additional information regarding copyright ownership. 
 the asf licenses this file to you under the apache license, version 2.0 
 (the "license"); you may not use this file except in compliance with 
 the license. you may obtain a copy of the license at 
 
   http://www.apache.org/licenses/license-2.0 
 
 unless required by applicable law or agreed to in writing, software 
 distributed under the license is distributed on an "as is" basis, 
 without warranties or conditions of any kind, either express or implied. 
 see the license for the specific language governing permissions and 
 limitations under the license. 
--> 
<!-- note: a "server" is not itself a "container", so you may not 
   define subcomponents such as "valves" at this level. 
  documentation at /docs/config/server.html 
 --> 
<server port="8005" shutdown="shutdown"> 
 
 <!--apr library loader. documentation at /docs/apr.html --> 
 <listener classname="org.apache.catalina.core.aprlifecyclelistener" sslengine="on" /> 
 <!--initialize jasper prior to webapps are loaded. documentation at /docs/jasper-howto.html --> 
 <listener classname="org.apache.catalina.core.jasperlistener" /> 
 <!-- prevent memory leaks due to use of particular java/javax apis--> 
 <listener classname="org.apache.catalina.core.jrememoryleakpreventionlistener" /> 
 <!-- jmx support for the tomcat server. documentation at /docs/non-existent.html --> 
 <listener classname="org.apache.catalina.mbeans.serverlifecyclelistener" /> 
 <listener classname="org.apache.catalina.mbeans.globalresourceslifecyclelistener" /> 
 
 <!-- global jndi resources 
    documentation at /docs/jndi-resources-howtohtml 
 --> 
 <globalnamingresources> 
  <!-- editable user database that can also be used by 
     userdatabaserealm to authenticate users 
  --> 
  <resource name="userdatabase" auth="container" 
       type="org.apache.catalina.userdatabase" 
       description="user database that can be updated and saved" 
       factory="org.apache.catalina.users.memoryuserdatabasefactory" 
       pathname="conf/tomcat-users.xml" /> 
 </globalnamingresources> 
 
 <!-- a "service" is a collection of one or more "connectors" that share 
    a single "container" note: a "service" is not itself a "container",  
    so you may not define subcomponents such as "valves" at this level. 
    documentation at /docs/config/service.html 
  --> 
 <service name="catalina"> 
  
  <!--the connectors can use a shared executor, you can define one or more named thread pools--> 
  <!-- 
  <executor name="tomcatthreadpool" nameprefix="catalina-exec-"  
    maxthreads="150" minsparethreads="4"/> 
  --> 
   
   
  <!-- a "connector" represents an endpoint by which requests are received 
     and responses are returned. documentation at : 
     java http connector: /docs/config/http.html (blocking & non-blocking) 
    java ajp connector: /docs/config/ajp.html 
    apr (http/ajp) connector: /docs/apr.html 
     define a non-ssl http/1 connector on port 8080 
  --> 
  <connector port="8080" protocol="http/1.1"  
        connectiontimeout="20000"  
        redirectport="8443" /> 
  <!-- a "connector" using the shared thread pool--> 
  <!-- 
  <connector executor="tomcatthreadpool" 
        port="8080" protocol="http/1.1"  
        connectiontimeout="20000"  
        redirectport="8443" /> 
  -->       
  <!-- define a ssl http/1.1 connector on port 8443 
     this connector uses the jsse configuration, when using apr, the  
     connector should be using the openssl style configuration 
     described in the apr documentation --> 
  <!-- 
  <connector port="8443" protocol="http/1" sslenabled="true" 
        maxthreads="150" scheme="https" secure="true" 
        clientauth="false" sslprotocol="tls" /> 
  --> 
 
  <!-- define an ajp 1.3 connector on port 8009 --> 
  <connector port="8009" protocol="ajp/1.3" redirectport="8443" /> 
 
 
  <!-- an engine represents the entry point (within catalina) that processes 
     every request the engine implementation for tomcat stand alone 
     analyzes the http headers included with the request, and passes them 
    on to the appropriate host (virtual host). 
    documentation at /docs/config/engine.html --> 
 
  <!-- you should set jvmroute to support load-balancing via ajp ie : 
  <engine name="catalina" defaulthost="localhost" jvmroute="jvm1">      
  -->  
  <engine name="catalina" defaulthost="localhost"> 
 
   <!--for clustering, please take a look at documentation at: 
     /docs/cluster-howto.html (simple how to) 
     /docs/config/cluster.html (reference documentation) --> 
   <!-- 
   <cluster classname="org.apache.catalina.ha.tcp.simpletcpcluster"/> 
   -->     
 
   <!-- the request dumper valve dumps useful debugging information about 
      the request and response data received and sent by tomcat. 
      documentation at: /docs/config/valve.html --> 
   <!-- 
   <valve classname="org.apache.catalina.valves.requestdumpervalve"/> 
   --> 
 
   <!-- this realm uses the userdatabase configured in the global jndi 
      resources under the key "userdatabase". any edits 
      that are performed against this userdatabase are immediately 
      available for use by the realm. --> 
   <realm classname="org.apache.catalina.realm.userdatabaserealm" 
       resourcename="userdatabase"/> 
 
   <!-- define the default virtual host 
      note: xml schema validation will not work with xerces 2.2. 
    --> 
   <host name="localhost" appbase="webapps" 
      unpackwars="true" autodeploy="true" 
      xmlvalidation="false" xmlnamespaceaware="false"> 
 
    <!-- singlesignon valve, share authentication between web applications 
       documentation at: /docs/config/valve.html --> 
    <!-- 
    <valve classname="org.apache.catalina.authenticator.singlesignon" /> 
    --> 
 
    <!-- access log processes all example. 
       documentation at: /docs/config/valve.html --> 
    <!-- 
    <valve classname="org.apache.catalina.valves.accesslogvalve" directory="logs"  
        prefix="localhost_access_log." suffix=".txt" pattern="common" resolvehosts="false"/> 
    --> 
 
   </host> 
  </engine> 
 </service> 
</server>

以上就是关于“servlet和tomcat的知识点有哪些”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注编程之家行业资讯频道。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


&lt;servlet&gt; &lt;servlet-name&gt;tomcatpooljsp&lt;/servlet-name&gt; &lt;jsp-file&gt;/WEB-INF/tomcatpool.jsp&lt;/jsp-file&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;tomcatpooljsp&lt;/servlet-nam...
遵循Java Servlet 规范第4节中的建议 ,Apache Tomcat实现了系统地重新加载Java类的方法,以允许在不重新启动整个服务器的情况下更新应用程序的组件。 此功能对于开发非常重要,因为事实证明,随着服务器启动和重启时间的延长,这会严重浪费开发人员的时间。实际上,Java EE堆栈应用服务器的服务器重新启动时间很慢,这是Tomcat广泛用于个人和企业级项目的推动力之一。但是,即使Tomcat也无法 像运行时重新加载应用程序一样快地启动。通过仅重新加载隔离的应用程序的更改的类,开发人员..
JMX(Java管理扩展)是一项非常强大的技术,可让您管理,监视和配置Tomcat MBean。如果您是Tomcat管理员,那么您应该熟悉如何在tomcat中启用JMX来监视堆内存,线程,CPU使用率,类以及配置各种MBean。在本文中,我将讨论如何使用JConsole启用并连接到Tomcat。我假设您已经安装了Tomcat(如果没有);您可以参考安装指南。转到安装了Tomcat的路径 转到bin文件夹 将文件创建为“ setenv.sh” 使用vi编辑器修改文件并添加以下内容
总览介绍 建立 取得Java 获取TomCat 将TomCat安装为Windows服务 将TomCat设置为Linux服务(系统化) 使用Nginx作为反向代理 基本用法 手动启动和停止TomCat 验证TomCat服务器正在运行 服务静态文件 服务Java服务器页面(JSP) 修改设定 部署网络应用 使用管理网页界面 创建一个TomCat管理员用户 访问管理网络应用 管理网络应用 结论 参考链接介绍在最简单的概念中,To.
PSI Probe是Lambda Probe的社区驱动分支,使用相同的开源许可证(GPLv2)分发。它旨在替换和扩展Tomcat Manager,从而使管理和监视Apache Tomcat实例更加容易。与许多其他服务器监视工具不同,PSI Probe不需要对现有应用程序进行任何更改。它通过可访问Web的界面提供所有功能,只需将其部署到服务器即可使用。这些功能包括:请求:即使在每个应用程序的基础上,实时监视流量。 会话:浏览/搜索属性,查看上一个IP,到期,估计大小。 JSP:浏览,查看源代码,进
监视和管理Tomcat目录介绍 启用JMX远程 使用JMX远程Ant任务管理Tomcat JMXAccessorOpenTask-JMX打开连接任务 JMXAccessorGetTask:获取属性值Ant任务 JMXAccessorSetTask:设置属性值Ant任务 JMXAccessorInvokeTask:调用MBean操作Ant任务 JMXAccessorQueryTask:查询MBean Ant任务 JMXAccessorCreateTask:远程创建MBean Ant任
1.tomcat与jetty都是一种servlet引擎,他们都支持标准的servlet规范和javaEE规范
“The origin server did not find a current representation for the target resource...
Artifacts是maven中的一个概念,表示某个module要如何打包,例如war exploded、war、jar、ear等等这种打包形式;
使用 IDEA 编辑器开发项目十分便捷,这里介绍使用 IDEA 编辑器添加 Tomcat
这篇“servlet和tomcat的知识点有哪些”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅...
这篇文章主要讲解了“Tomcat管理平台实例分析”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Tomcat管理平...
本文小编为大家详细介绍“tomcat虚拟主机怎么配置”,内容详细,步骤清晰,细节处理妥当,希望这篇“tomcat虚拟主机怎么配置”文章能帮助大家解决疑惑,下面跟
今天小编给大家分享一下tomcat相关配置与eclipse集成的方法的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家
这篇“Tomcat之web应用的目录组成结构是怎样的”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,
今天小编给大家分享一下tomcat目录映射的方法的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大...
这篇“tomcat的环境怎么配置”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文...
环境:tomcat:apache-tomcat-7.0.35 cactiEZ:10.1系统:centos5.6_x64一、配置tomcat服务器1、添加账号vim tomcat-users.xml 重启tomcat2、安装snmp协议yum...
一、 软环下载地址软件链接地址https://files.cnblogs.com/files/jinrf/openssl-1.0.2-latest.tar.gzhttps://files.cnblogs.com/files/jinrf/apr-util-1.6...