新手:Web.xml Eclipse。 xsi:schemaLocation&的xmlns:网络 [英] Newbie: Web.xml Eclipse. xsi:schemaLocation & xmlns:web

查看:317
本文介绍了新手:Web.xml Eclipse。 xsi:schemaLocation&的xmlns:网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

2.5 xsd和3.0 xsd。为什么有2个xsd?

2.5 xsd and 3.0 xsd. Why there are 2 xsd?

Project Spec:
    Server info: Apache Tomcat/7.0.27
     Servlet version: 3.0
     JSP version: 2.1
     Java version: 1.6.0_32


<?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" 
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
id="WebApp_ID" version="3.0">
  <display-name>MyFirstApp</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>


推荐答案

因为您的自动生成器(您生成此代码?) Web.xml选择xmlns:web和xsi:schemaLocation的最后和更好版本。

Because your autogenerator (you generate this code with?) of Web.xml choice the last and better version for your xmlns:web and for your xsi:schemaLocation.

在2个元素上使用不同的xsd版本不是问题我认为是web.xml。如果你有问题请转到2.5版本。

It's not a problem to have different xsd version on 2 elements of the web.xml I think. If you have a problem go to 2.5 version.

我看到你正在使用JSP,也许最好看看JSF2.0 + Primefaces 3.2?

I see you are using JSP, maybe it's better to look to JSF2.0 + Primefaces 3.2 ?

这篇关于新手:Web.xml Eclipse。 xsi:schemaLocation&amp;的xmlns:网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆