The "web.xml" is called web application deployment descriptor
3.3 Configure the Application Deployment Descriptor - "web.xml"
A web user invokes a servlet, which is kept in the web server, by issuing a specific URL from the browser. In this example, we shall configure the following request URL to trigger the "HelloServlet":
http://hostname:port/helloservlet/sayhello
Create a configuration file called "web.xml", and save it under "webapps\helloservlet\WEB-INF", as follows:
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
- The "
web.xml" is called web application deployment descriptor. It provides the configuration options for that particular web application, such as defining the the mapping between URL and servlet class. - The above configuration defines a servlet named "
HelloWroldServlet", implemented in "mypkg.HelloServlet.class" (written earlier), and maps to URL "/sayhello", where "/" denotes the context root of this webapp "helloservlet". In other words, the absolute URL for this servlet ishttp://hostname:port/helloservlet/sayhello.
- Take note that EACH servlet requires a pair of
<servlet>and<servlet-mapping>elements to do the mapping, via an arbitrary but unique<servlet-name>. Furthermore, all the<servlet>elements must be grouped together and placed before the<servlet-mapping>elements (as specified in the XML schema).
https://www.ntu.edu.sg/home/ehchua/programming/java/JavaServlets.html
The "web.xml" is called web application deployment descriptor的更多相关文章
- web.xml中使用web前缀配置无法访问controller
<web:context-param> <web:param-name>contextConfigLocation</web:param-name> <web ...
- javaWeb项目中web.xml的xsd( XML Schemas Definition)文件
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns="http://w ...
- web.xml的说明
<!--DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright 2000-2007 Sun Microsystems ...
- Analysis of Web.xml in Hello1 project
一.web.xml文件介绍 The web.xml file contains several elements that are required for a Facelets applicatio ...
- Descriptors;Hello1 project中的Web.xml
Deployment Descriptors(描述符)是一个xml文件,用来描述如何部署一个模块或者应用(根据描述符中定义的配置和容器选项).举例来说,一个EJB的部署描述符会向EJB容器传递如何管理 ...
- [从零开始搭网站五]http网站Tomcat配置web.xml和server.xml
点击下面连接查看从零开始搭网站全系列 从零开始搭网站 上一章我们在CentOS下搭建了Tomcat,但是还是没有跑起来...那么这一章就把最后的配置给大家放上去. 有两种方式:一种是用 rm -f 给 ...
- web.xml文件的 xsd引用(或dtd引用)学习
1. 为什么web.xml会有不同版本的xsd引用: JDK依赖变化: 或 servlet(JAVA EE)自身API的改变: 2. 为什么会有dtd和xsd两个版本的区别 我是在这篇文章中看到的,作 ...
- Java Web的web.xml文件作用及基本配置(转)
其实web.xml就是asp.net的web.config一个道理. 说明: 一个web中完全可以没有web.xml文件,也就是说,web.xml文件并不是web工程必须的. web.xml文件是用来 ...
- spring web.xml 难点配置总结
web.xml web.xml是所有web项目的根源,没有它,任何web项目都启动不了,所以有必要了解相关的配置. ContextLoderListener,ContextLoaderServlet, ...
随机推荐
- 网页为什么会乱码?浅析字符集编码ASCII和Unicode
因为编码不对! 什么是编码?编码不对为什么会乱码? ……?? 编码转换为什么会丢失数据? ……?? 不管是数据库还是网页,都可能碰到过乱码问题 在计算机世界里,所有数据都使用二进制存储,即只有1和0, ...
- Java面试 - == 和 equals 的区别?
==:如果比较的对象是基本数据类型,则比较的是数值是否一致:如果比较的是引用数据类型,则比较的是对象的地址值是否一致. equals():equals()方法不能用于比较基本数据类型的对象,如果对象和 ...
- JSON、GSON
文章目录 什么是JSON 特点 JSON的数据结构 -- Object JSON的数据结构 -- Array JSON的数据结构 -- 基本类型 构建 JSON 数据 解析 JSON 数据 GSON ...
- ubuntu中不能使用终端的情况
跟着网上的步骤去升级了一波python3,可谓一波未平! 当我将ubuntu中自带的python3.5升级3.6时,突然发现一个问题,怎么终端打不开了,于是去百度,找到一个博主的笔记,和我的情况一模一 ...
- php类常量
类常量类常量可以使用define定义,也可用const定义,但是在类的内部,只允许用const定义,类常量不能更新,也不能删除类常量通常是大写的,两个单词之间用下滑线连接,如MY_NATION类常量在 ...
- go语言基础学习网址
go指南 http://tour.studygolang.com/welcome/1
- 『Python基础』第2节: Python简介及入门
一. Python介绍 Python是一门高级计算机程序设计语言,1989年,荷兰的Guido von Rossum创造了它.Guido是是一个牛人,1982年,他从阿姆斯特丹大学获得了数学和计算机硕 ...
- R|批量循环处理同一格式文件-csv,txt,excel
本文首发于“生信补给站”微信公众号,https://mp.weixin.qq.com/s/8IfMrSr9xc8_1Y2_9Ne6hg 在一个文件夹下有很多字段一致,格式统一的数据文件(csv,txt ...
- [Vue]vue-router嵌套路由(子路由)
总共添加两个子路由,分别命名Collection.vue(我的收藏)和Trace.vue(我的足迹) 1.重构router/index.js的路由配置,需要使用children数组来定义子路由,具体如 ...
- ORACLE:锁被未决分布式事务处理 18.27.160617 持有
1. 以管理员账号登陆 2. rollback force '18.27.160617 ';