J2EE deployment files(web.xml)

Java Web开发环境搭建与Servlet入门指南 Java Web开发是现代企业级应用的基础技术栈,其核心在于理解HTTP请求-响应模型与Servlet容器的工作原理。通过配置JDK运行环境和Tomcat服务器,开发者可以快速搭建Java Web开发环境。Servlet作为处理Web请求的核心组件,遵循特定的生命周期管理,配合JSP技术实现动态页面渲染。在企业级开发中,合理的项目结构、代码规范和安全管理是保障系统稳定性的关键。掌握这些基础技术后,开发者可以平滑过渡到Spring Boot等现代框架,构建更复杂的分布式系统。 阅读详情
<web-app>
This file contains the configuration for a web-application.

<icon>
The icon element contains a small-icon and a large-icon element which specify the location within the web application for a small and large image used to represent the web application in a GUI tool.

<small-icon>path/to/icon.gif</small-icon>
The small-icon element contains the location within the web application of a file containing a small (16x16 pixel) icon image. The image must be either GIF or JPEG format and the filename must end with the extension of ".gif" or ".jpg".

<large-icon>path/to/icon.gif</large-icon>
The large-icon element contains the location within the web application of a file containing a large (32x32 pixel) icon image. The image must be either GIF or JPEG format and the filename must end with the extension of ".gif" or ".jpg".

 
<display-name>A friendly name</display-name>
A friendly name that describes this unit.

<description>The description</description>
A short description, use etc.

<distributable />
The distributable element, by its presence in a web application deployment descriptor, indicates that this web application is programmed appropriately to be deployed into a distributed servlet container.

<context-param>
The context-param element contains the declaration of a web application's servlet context initialization parameters. There are two special kinds of initialization parameters for the optional cases where the parameter is used to obtain the JNDI name of an EJB or a data source for a subsequent look up. These are indicated by an context-param element together with an accompanying ejb-ref or resource-ref element with matching name.

<param-name>theName</param-name>
The name of the configuration parameter.

<param-value>theValue</param-value>
The value of the configuration parameter.

 
<servlet>
The servlet element contains the declarative data of a servlet. If a jsp-file is specified and the load-on-startup element is present, then the JSP should be precompiled and loaded.

<icon>
The icon element contains a small-icon and a large-icon element which specify the location within the web application for a small and large image used to represent the web application in a GUI tool.

<small-icon>path/to/icon.gif</small-icon>
The small-icon element contains the location within the web application of a file containing a small (16x16 pixel) icon image. The image must be either GIF or JPEG format and the filename must end with the extension of ".gif" or ".jpg".

<large-icon>path/to/icon.gif</large-icon>
The large-icon element contains the location within the web application of a file containing a large (32x32 pixel) icon image. The image must be either GIF or JPEG format and the filename must end with the extension of ".gif" or ".jpg".

 
<servlet-name>servletname</servlet-name>
The canonical name of the servlet.

<display-name>A friendly name</display-name>
A friendly name that describes this unit.

<description>The description</description>
A short description, use etc.

<servlet-class>com.company.servlet.DummyServlet</servlet-class>
The class name of a servlet.

<jsp-file>jsp/file/name.jsp</jsp-file>
The path to a JSP file within the web application.

<init-param>
Contains a name/value pair initialization param.

<param-name>theName</param-name>
The name of the configuration parameter.

<param-value>theValue</param-value>
The value of the configuration parameter.

 
<load-on-startup>priorityNumber</load-on-startup>
Indicates that this servlet should be loaded on startup. The optional contents of these element must be an integer indicating the order in which the servlet should be loaded.

<security-role-ref>
The security-role-ref element contains the declaration of a security role reference in the servlet's code. The contents of the role-name element is that of the String used in the servlet code to specify a role. The role-link element specifies that this coded role should be linked to a role described by the security-role element.

<description>The description</description>
A short description, use etc.

<role-name>myRole</role-name>
Defines a role name that the developer can use. The deployer maps a set of users and groups to the role name at deployment time.

<role-link>realname</role-link>
The role-link element is used to link a security role reference to a defined security role. The role-link element must contain the name of one of the security roles defined in the security-role elements.

 
 
<servlet-mapping>
Defines a mapping between a servlet and a url pattern.

<servlet-name>servletname</servlet-name>
The canonical name of the servlet.

<url-pattern>/*.thePattern</url-pattern>
The url pattern of the mapping.

 
<session-config>
Defines the session parameters for this web application.

<session-timeout>session-timeout</session-timeout>
Defines the default session timeout interval for all sessions created in this web application. The default units are measured in minutes.

 
<mime-mapping>
Defines a mapping between and extension and a mime type.

<extension>.txt</extension>
An extension. example: ".txt".

<mime-type>text/plain</mime-type>
A defined mime type. example: "text/plain".

 
<welcome-file-list>
An ordered list of welcome files.

<welcome-file>index.html</welcome-file>
A welcome file, this file will be served to the user for incoming requests without a file specified (specifying a directory) if it exists. Examples are: index.html, default.jsp, other.file.

 
<error-page>
Contains a mapping between an error code or exception type to the path of a resource in the web application.

<error-code>theErrorCodeNumber</error-code>
The HTTP error code, ex: 404.

<exception-type>java.exception.TypeOfException</exception-type>
A Java exception type.

<location>path/to/resource</location>
The location of the resource in the web application.

 
<resource-ref>
The optional resource-ref element contains a declaration of a Web Application's reference to an external resource. An context-param with the same name must be present whose value will be the JNDI data source. The context-param's value may be specified at deployment time.

<description>The description</description>
A short description, use etc.

<res-ref-name>theContextParam</res-ref-name>
Specifies the name of the resource factory reference name. This value is the name of the context-param whose value contains the JNDI name of the data source.

<res-type>com.the.TypeOfResource</res-type>
Specifies the (Java class) type of the data source.

<res-auth>CONTAINER|SERVLET</res-auth>
The res-auth element indicates whether the application component code performs resource signon programmatically or whether the container signs onto the resource based on the principle mapping information supplied by the deployer. Must be CONTAINER or SERVLET.

 
<security-constraint>
Used to associate security constraints with one or more web resource collections.

<web-resource-collection>
Used to identify a subset of the resources and HTTP methods on those resources within a web application to which a security constraint applies.

<web-resource-name>The resource name</web-resource-name>
The name of this web resource collection.

<description>The description</description>
A short description, use etc.

<url-pattern>/*.thePattern</url-pattern>
The url pattern of the mapping.

<http-method>METHOD</http-method>
A HTTP method (GET | POST |...).

 
<auth-constraint>
Indicates the user roles that should be permitted access to this resource collection as well as the authorization method to be used.

<description>The description</description>
A short description, use etc.

<role-name>myRole</role-name>
Defines a role name that the developer can use. The deployer maps a set of users and groups to the role name at deployment time.

 
<user-data-constraint>
Used to indicate how data communicated between the client and container should be protected.

<description>The description</description>
A short description, use etc.

<transport-guarantee>NONE/INTEGRAL/CONFIDENTIAL</transport-guarantee>
The transport-guarantee element specifies that the communication between client and server should be NONE, INTEGRAL, or CONFIDENTIAL.

 
 
<login-config>
The login-config element is used to configure the authentication method that should be used, the realm name that should be used for this application, and the attributes that are needed by the form login mechanism.

<auth-method>BASIC/DIGEST/FORM/CLIENT-CERT</auth-method>
The auth-method element is used to configure the authentication mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization constraint, a user must have authenticated using the configured mechanism. Legal values for this element are "BASIC", "DIGEST", "FORM", or "CLIENT-CERT".

<realm-name>Name Of Realm</realm-name>
The realm name element specifies the realm name to use in HTTP Basic authorization.

<form-login-config>
The form-login-config element specifies the login and error pages that should be used in form based login. If form based authentication is not used, these elements are ignored.

<form-login-page>path/to/loginpage.jsp</form-login-page>
Defines the location in the web app where the page that is used for login can be found.

<form-error-page>path/to/errorpage.jsp</form-error-page>
Defines the location in the web app where the error page that is displayed when login is not successful can be found.

 
 
<security-role>
The security-role element contains the declaration of a security role which is used in the security-constraints placed on the web application.

<description>The description</description>
A short description, use etc.

<role-name>myRole</role-name>
Defines a role name that the developer can use. The deployer maps a set of users and groups to the role name at deployment time.

 
<env-entry>
The env-entry element contains the declaration of an application's environment entry. This element is required to be honored on in J2EE compliant servlet containers.

<description>The description</description>
A short description, use etc.

<env-entry-name>nameOfEntry</env-entry-name>
The env-entry-name contains the name of an application's environment entry.

<env-entry-value>value</env-entry-value>
The env-entry-value element contains the value of an application's environment entry.

<env-entry-type>java.lang.String</env-entry-type>
The env-entry-type element contains the fully qualified Java type of the environment entry value that is expected by the application code. The following are the legal values of env-entry-type: java.lang.Boolean, java.lang.String, java.lang.Integer, java.lang.Double, java.lang.Float.

 
<ejb-ref>
Used in conjunction with a matching context-param of the same name to indicate that this parameter will be used to obtain the JNDI name of an EJB.

<description>The description</description>
A short description, use etc.

<ejb-ref-name>nameOfEJB</ejb-ref-name>
Contains the name of an EJB reference. This name must match an context-param name.

<ejb-ref-type>com.type.OfEJBBean</ejb-ref-type>
Contains the expected java class type of the referenced EJB.

<home>com.type.OfEJBHome</home>
Contains the fully qualified name of the EJB's home interface.

<remote>com.type.OfEJB</remote>
Contains the fully qualified name of the EJB's remote interface.

<ejb-link>nameOfEJB</ejb-link>
Used in the ejb-ref element to specify that an EJB reference is linked to an EJB in an encompassing J2EE application package. The value of the ejb-link element must be the ejb-name of and EJB in the J2EE application package.

 
<taglib>
Defines a taglib name in order to simplify the definition inside JSP-pages.

<taglib-uri>myTags</taglib-uri>
The uri as defined in the taglib directive in the JSP-pages.

<taglib-location>/WEB-INF/lib/mytags.jar</taglib-location>
The location of the library or a standalone TLD (relative or absolute URL).
Eclipse 2025深度适配JDK 21:从字节码兼容到OSGi模块治理 Java开发环境正经历从IDE工具向JVM基础设施的范式迁移。随着JDK 21引入虚拟线程、模式匹配、record与sealed类等核心特性,传统IDE的编译器前端(如Eclipse JDT)面临AST解析、字节码生成、模块验证三重断层。其本质是JVM语言规范升级倒逼开发工具链重构——不仅要求支持新语法,更需深度集成JDK 21的运行时契约与模块系统(java.se)。这直接关系到Spring Boot 3.3+项目的编译正确性、调试可靠性及Lombok等注解处理器的字节码注入能力。本文聚焦Eclipse 阅读详情

相关推荐

Eclipse JEE版下载与配置全指南:win32-x86-64包解析

Eclipse IDE 是 Java 开发者最常用的集成开发环境之一,其发行版按功能与平台精细划分。Java EE(现 Jakarta EE)开发需专用 JEE 版本,而非通用 Standard 版;而 'win32-x86-64' 并非指 32 位系统,实为 Eclipse 对 Windows 平台的命名惯例,真实架构标识是 x86-64,要求匹配 64 位 Windows 和 64 位 JDK。该版本预装 Web 开发工具链、Tomcat 适配器及 Memory Analyzer(MAT),显著降低企业

weixin_34354945的博客 373

Servlet规范简介

Servlet规范简介 引言 Web 框架一般是通过一个 Servlet 提供统一的请求入口,将指定的资源映射到这个 servlet, 在这个 servlet 中进行框架的初始化配置,访问 Web 页面中的数据,进行逻辑处理后,将结果数据与的表现层相融合并展现给用户。 WEB 框架想要在符合 Servlet 规范的容器中运行,同样也要符合 Servlet 规范。 将一个 WEB 框架注

学海无涯 享受学习的过程 2448

Vivado里LDPC IP核怎么配?手把手教你从6144bit数据到完整参数设置

本文详细介绍了在Vivado中配置LDPC IP核的完整流程,从6144bit数据的参数计算到实际IP核设置。通过分析基本图选择、扩展因子计算和移位参数确定等关键步骤,帮助工程师高效完成LDPC编译码的硬件实现,并提供了时序控制、仿真验证和性能优化的实用技巧。

weixin_30352645的博客 518

web.xml报错:Servlet should have a mapping

打开Project Structure界面,Modules>Web>Deployment descriptor,修改正确的位置即可(修改后无效果重启下应用)原因:web.xml位置配置错误。

iranw的专栏 1354

基于扩展卡尔曼滤波(EKF)结合到达时间(TDOA)、到达频率(FDOA)实现多无人机无源定位,MATLAB代码

该程序实现了一种结合到达时间差(TDOA)和到达频率差(FDOA)技术的多无人机定位方法,利用扩展卡尔曼滤波(EKF)对单一目标进行定位。程序通过模拟多无人机的运动及其与目标的相对位置,估计目标的状态(位置和速度)。

985工科博士毕业,专攻定位、导航和滤波等算法研究。从业10年,主要使用MATLAB 1266

fpga学习——zynq图像处理中的DVP流接口封装

之前文章介绍了基于zynq的图像处理架构问题。其中,作为开发者,需要重点关注图像传感器接口、处理算法、显示接口,这些模块。现在我们一同学习用于视频数据接口的DVP模块,并将其封装成AXI-stream接口便于直接和VDMA IP通信。 DVP_AXI stream IP v1.0使用说明 1.设计概述 •用于cmos传感器视频数据采集,将cmos输出的8位视频数据拼接成RGB 565模式 •AXI_stream主机接口,用于和PS端内存的数据交互 •基于vivado 18.3软件设计 2.模块分析

weixin_41895751的博客 4582

web.xml文件解析

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee     http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"                      sun的已归属oracle,此xsd可以在http://www.oracle.com/webfolder/technetwor

itm94lj的博客 3150

UE4-(反射)场景采集之场景采集2D

一、场景采集分为两种:场景采集2D、场景采集立方体 场景采集2D:采集2D图片模式。 操作: 1.选择场景采集2D,是一个摄像机的物体,摆放到场景中。 2.在文件夹空白处创建纹理,一定要注意创建纹理的格式, 纹理分为立方体渲染目标和渲染目标,此处我们使用的是2D模式,所以选择渲染目标(Texture Render Target2D)。创建后重命名为RenderTextue2D。 3.选择场景中刚拖入的 SceneCapture2D 摄像机在细节面板的Scene Capture 将..

Stone的博客 4601

Servlet学习笔记

   [Servlet] ●  Servlet(Java服务器小程序),是用Java编写的服务器端程序。可以看成是用Java编写的CGI,但是功能和性能比CGI强多了。 ●  为了简化开发,我们编写的Servlet一般直接继承自HttpServlet,HttpServlet类封装了编写Http协议Servlet的大部分功能。     HttpServlet类继承自javax.servlet...

csbison的专栏 850

GIS小白也能看懂的实战:5步教你将ArcGIS里的等高线和水系完美导入CAD做规划图

本文详细介绍了如何将ArcGIS中的等高线和水系数据高效导入CAD,制作专业规划底图的5个关键步骤。从数据准备、ArcGIS处理到CAD优化,涵盖坐标系设置、数据裁剪、格式转换等实用技巧,特别适合设计规划领域的新手快速掌握GIS与CAD协同工作流程。

weixin_27966471的博客 426

软件工程实验报告--用Visio绘制数据流图、ER图、状态图、软件结构图、程序流程图、系统流程图

用Visio绘制数据流图、ER图、状态图、软件结构图、程序流程图、系统流程图

m0_73814332的博客 4162

J2EE deployment files (application.xml)

The application element is the root element of a J2EE application deployment descriptor. The icon element contains a small-icon and a large-icon element which specify the l

JofeeDong's Blog 1480

electron windows设置镜像地址环境变量报错npm error `ELECTRON_MIRROR` is not a valid npm option

如果你是在使用某个特定的脚本或配置文件,请检查该文件中是否有不正确的配置项,并进行相应的修正。确保你遵循electron的官方安装指南,并且没有包含不必要的或错误的配置选项。如果问题依然存在,可以查看npm的官方文档或者相关社区获取更多帮助。

qq_36158551的博客 3324

JavaWeb_tomcat设置默认应用

在tomcat的server.xml文件中设置默认应用。 在tomcat文件目录里面的conf/server.xml文件中,在<Engine>...</Engine>中再增加一个<Host name="www.flx.com" appBase="c:\flx"><Context path="" docBase="c:\flx\mail"/&gt...

dieyuqi2955的博客 116

AI辅助决策支持系统架构设计避坑:5个常见技术选型误区及正确方案

AI辅助决策支持系统(AI-DSS)是指通过人工智能技术(机器学习、自然语言处理、知识图谱等)赋能传统决策支持系统,帮助决策者在复杂业务场景中(如供应链优化、风险控制、医疗诊断、金融投资等)提升决策效率和准确性的系统。与传统BI工具不同,AI-DSS不仅能"展示数据",还能基于数据生成"决策建议"甚至"自动执行决策"。技术选型是AI-DSS架构设计的核心环节,涉及数据处理引擎、模型框架、算力资源、集成接口等关键组件的选择。效果不达标:模型预测精度低、决策建议不可用;成本失控:算力资源浪费、维护成本高企。

AIGC应用创新大全的博客 1382

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

.jar/war/ear包的区别

<br />以最终客户的角度来看,.jar文件就是一种封装,他们不需要知道.jar文件中有多少个.class文件,每个文件中的功能与作用,同样可以得到他们希望的结果。除jar以外对于J2EE来说还有war和ear。区别见下表:<br /> <br /> JAR<br /> WAR<br /> EAR 英文 Java Archive file  Web Archive file Enterprise Archive file 包含内容 class、properties文件,是文件封装的最小单元; Servle

onetree2010的专栏 6279

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

JB1-1-新手村

项目开发流程,学习路线,学习技巧,环境准备,Java语言特点(编程语言分代,跨平台),笔记(Markdown语法,Notepad3工具,Obsidian工具),开发环境(JDK,HelloWorld详解),集成开发工具(IDEA安装,配置,插件),Maven(仓库,镜像,父子工程,常用命令),Junit单元测试,Git协同开发等。

周航宇的博客 3919

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

工作中使用到的单词(软件开发)

1.エイリアス   alias 别名 powershell使用 get-help 命令时,会得到与此命令 相关(别名)的命令 2.プロキシ proxy 代 理 3.プロモート   promote 促进,提升   开发的系统新功能上线发布,有时会使用到这个词,比如 STプロモート 还有使用リリース这个词的。比如STリリース。个人认为两者含义相同。 4.見逃し み................................................................

sun0322 6万+

java项目引入xsd文件_javaWeb项目中web.xml的xsd( XML Schemas Definition)文件

@(#)web-app_2_5.xsds 1.68 07/03/09DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.Copyright 2003-2007 Sun Microsystems, Inc. All rights reserved.The contents of this file are subject to the...

weixin_39589241的博客 725

(Servlet)常见错误及解决方式

404错误 404数字 指的是:服务器执行完客户端的请求后,返回给客户端一个执行结果的状态编码。 产生的原因:Web服务器(容器)根据请求地址找不到对应资源。 如: ①地址错误(拼写不正确,字母大小写错误) ②web.xml文件中的两个不一致 ③工程没有部署 ④Web应用程序部署结构没有遵守Servlet规范 404错误的解决方法 按照http://ip:port/appName

行者常至 4021

Servlet容器Tomcat中web.xml中url-pattern的配置详解[附带源码分析]

目录 前言 现象 源码分析 实战例子 总结 参考资料 前言 今天研究了一下tomcat上web.xml配置文件中url-pattern的问题。 这个问题其实毕业前就困扰着我,当时忙于找工作。 找到工作之后一直忙,也就没时间顾虑这个问题了。 说到底还是自己懒了,没花时间来研究。 今天看了tomcat的部分源码 了解了这个url-pattern的机制。 下面让我一一道来。...

weixin_34190136的博客 1119

web.xml配置文件的dtd(http://java.sun.com/dtd/web-app_2_3.dtd)

DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.Copyright 2000-2007 Sun Microsystems, Inc. All rights reserved.The contents of this file are subject to the terms of either the GNUGeneral P

我的空间 1万+

JavaWeb开发中,servlet的url-pattern的映射规则

原文出处:http://www.cnblogs.com/mailingfeng/archive/2012/04/05/2432687.html

tiger的专栏 3436
上一篇: J2EE deployment files(ejb-jar2.0.xml)
下一篇: J2EE deployment files(application-client.xml)
Jofee
博客等级 码龄23年 14粉丝 24原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值