glassfish-web.xml vs sun-web.xml vs web.xml

glassfish-web.xml vs sun-web.xml vs web.xml,glassfish,web.xml,Glassfish,Web.xml,有人能解释一下glassfishweb.xml、sunweb.xml和web.xml之间的主要区别(或提供链接) 我可以在我的webapp中只使用glassfishweb.xml而跳过其他的吗? web.xml:JavaEE定义的标准部署描述符(特别是ServletJSR,但被许多JSR使用)。它用于指定web容器用于跨应用程序服务器(例如servlet的URL端点)以可移植的方式部署应用程序的元数据。在JavaEE6及更高版本中,当元数据由Java代码中的注释(如@WebServlet)提供时

有人能解释一下
glassfishweb.xml
sunweb.xml
web.xml
之间的主要区别(或提供链接)

我可以在我的webapp中只使用glassfishweb.xml而跳过其他的吗?

  • web.xml:JavaEE定义的标准部署描述符(特别是ServletJSR,但被许多JSR使用)。它用于指定web容器用于跨应用程序服务器(例如servlet的URL端点)以可移植的方式部署应用程序的元数据。在JavaEE6及更高版本中,当元数据由Java代码中的注释(如@WebServlet)提供时,它是可选的(取决于您使用的技术)
  • glassfish web.xml:每个应用程序服务器都提供特定于实现的功能。要为GlassFish配置这些功能,请使用GlassFish-web.xml。这是我的房间
  • sunweb.xml:遗留应用程序服务器特定的部署描述符,已被glassfish-web.xml取代。在Sun被甲骨文收购后,使用这个名字就不再有意义了。此文件名仍然支持向后兼容,但您应该迁移到glassfish-web.xml
您可能需要也可能不需要web.xml文件。这取决于您使用的JavaEE特性。默认情况下,不使用这些文件中的任何一个,只使用像@WebServlet这样的javaee注释。当您构建应用程序并开始使用一些需要web.xml文件的功能(比如定义JavaServerFacesServlet)时,请使用web.xml文件。至于glassfish-web.xml,如果您要为应用程序配置glassfish特定的功能,则只能使用一个

Java EE教程也是学习Java EE的好方法,它与GlassFish 4捆绑在一起。

Web.xml
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>BusProject</display-name>
  <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>spring</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>spring</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
   <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/spring-servlet.xml</param-value>
  </context-param>  
  <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
 </web-app>
公共汽车项目 login.jsp 春天 org.springframework.web.servlet.DispatcherServlet 1. 春天 / 上下文配置位置 /WEB-INF/spring-servlet.xml org.springframework.web.context.ContextLoaderListener
hi,您能解释一下web logic.xml在所有这些文件中的位置吗?WebLogic.xml类似于glassfish-web.xml,但包含特定于WebLogic的配置选项。另请看:这里的一些叙述会很好,特别是因为OP要求的是这样。问题的核心是“解释主要差异”,而这一完整的答案显然无法做到这一点。