本文整理汇总了Java中org.apache.tomcat.util.descriptor.XmlIdentifiers类的典型用法代码示例。如果您正苦于以下问题:Java XmlIdentifiers类的具体用法?Java XmlIdentifiers怎么用?Java XmlIdentifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlIdentifiers类属于org.apache.tomcat.util.descriptor包,在下文中一共展示了XmlIdentifiers类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setPublicId
import org.apache.tomcat.util.descriptor.XmlIdentifiers; //导入依赖的package包/类
public void setPublicId(String publicId) {
// Update major and minor version
if (publicId == null) {
return;
}
if (XmlIdentifiers.WEB_22_PUBLIC.equals(publicId)) {
majorVersion = 2;
minorVersion = 2;
this.publicId = publicId;
} else if (XmlIdentifiers.WEB_23_PUBLIC.equals(publicId)) {
majorVersion = 2;
minorVersion = 3;
this.publicId = publicId;
} else {
log.warn(sm.getString("webXml.unrecognisedPublicId", publicId));
}
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:18,代码来源:WebXml.java
示例2: setPublicId
import org.apache.tomcat.util.descriptor.XmlIdentifiers; //导入依赖的package包/类
public void setPublicId(String publicId) {
// Update major and minor version
if (publicId == null) {
return;
}
if (XmlIdentifiers.WEB_22_PUBLIC.equals(publicId)) {
majorVersion = 2;
minorVersion = 2;
this.publicId = publicId;
} else if (XmlIdentifiers.WEB_23_PUBLIC.equals(publicId)) {
majorVersion = 2;
minorVersion = 3;
this.publicId = publicId;
} else {
log.warn(sm.getString("webXml.unrecognisedPublicId", publicId));
}
}
开发者ID:how2j,项目名称:lazycat,代码行数:18,代码来源:WebXml.java
示例3: setPublicId
import org.apache.tomcat.util.descriptor.XmlIdentifiers; //导入依赖的package包/类
public void setPublicId(String publicId) {
// Update major and minor version
if (publicId == null) {
return;
}
switch (publicId) {
case XmlIdentifiers.WEB_22_PUBLIC:
majorVersion = 2;
minorVersion = 2;
this.publicId = publicId;
break;
case XmlIdentifiers.WEB_23_PUBLIC:
majorVersion = 2;
minorVersion = 3;
this.publicId = publicId;
break;
default:
log.warn(sm.getString("webXml.unrecognisedPublicId", publicId));
break;
}
}
开发者ID:nkasvosve,项目名称:beyondj,代码行数:22,代码来源:WebXml.java
示例4: testParsePublicIdVersion22
import org.apache.tomcat.util.descriptor.XmlIdentifiers; //导入依赖的package包/类
@Test
public void testParsePublicIdVersion22() {
WebXml webxml = new WebXml();
webxml.setPublicId(XmlIdentifiers.WEB_22_PUBLIC);
Assert.assertEquals(2, webxml.getMajorVersion());
Assert.assertEquals(2, webxml.getMinorVersion());
Assert.assertEquals("2.2", webxml.getVersion());
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:TestWebXml.java
示例5: testParsePublicIdVersion23
import org.apache.tomcat.util.descriptor.XmlIdentifiers; //导入依赖的package包/类
@Test
public void testParsePublicIdVersion23() {
WebXml webxml = new WebXml();
webxml.setPublicId(XmlIdentifiers.WEB_23_PUBLIC);
Assert.assertEquals(2, webxml.getMajorVersion());
Assert.assertEquals(3, webxml.getMinorVersion());
Assert.assertEquals("2.3", webxml.getVersion());
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:TestWebXml.java
示例6: doTestValidateVersion
import org.apache.tomcat.util.descriptor.XmlIdentifiers; //导入依赖的package包/类
private void doTestValidateVersion(String version) throws IOException, SAXException {
WebXml webxml = new WebXml();
// Special cases
if ("2.2".equals(version)) {
webxml.setPublicId(XmlIdentifiers.WEB_22_PUBLIC);
} else if ("2.3".equals(version)) {
webxml.setPublicId(XmlIdentifiers.WEB_23_PUBLIC);
} else {
webxml.setVersion(version);
}
// Merged web.xml that is published as MERGED_WEB_XML context attribute
// in the simplest case consists of webapp's web.xml file
// plus the default conf/web.xml one.
Set<WebXml> defaults = new HashSet<WebXml>();
defaults.add(getDefaultWebXmlFragment());
webxml.merge(defaults);
Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(), true);
XmlErrorHandler handler = new XmlErrorHandler();
digester.setErrorHandler(handler);
InputSource is = new InputSource(new StringReader(webxml.toXml()));
WebXml webxmlResult = new WebXml();
digester.push(webxmlResult);
digester.parse(is);
Assert.assertEquals(0, handler.getErrors().size());
Assert.assertEquals(0, handler.getWarnings().size());
Assert.assertEquals(version, webxml.getVersion());
Assert.assertEquals(version, webxmlResult.getVersion());
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:36,代码来源:TestWebXml.java
示例7: testWebapp_2_2
import org.apache.tomcat.util.descriptor.XmlIdentifiers; //导入依赖的package包/类
@Test
public void testWebapp_2_2() throws Exception {
XmlErrorHandler handler = new XmlErrorHandler();
Digester digester = DigesterFactory.newDigester(
true, true, new WebRuleSet(false), true);
digester.setErrorHandler(handler);
digester.push(new WebXml());
WebXml desc = (WebXml) digester.parse(
new File("test/webapp-2.2/WEB-INF/web.xml"));
Assert.assertEquals("2.2", desc.getVersion());
Assert.assertEquals(XmlIdentifiers.WEB_22_PUBLIC, desc.getPublicId());
Assert.assertEquals(0, handler.getErrors().size());
Assert.assertEquals(0, handler.getWarnings().size());
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:15,代码来源:TestSchemaValidation.java
示例8: testWebapp_2_3
import org.apache.tomcat.util.descriptor.XmlIdentifiers; //导入依赖的package包/类
@Test
public void testWebapp_2_3() throws Exception {
XmlErrorHandler handler = new XmlErrorHandler();
Digester digester = DigesterFactory.newDigester(
true, true, new WebRuleSet(false), true);
digester.setErrorHandler(handler);
digester.push(new WebXml());
WebXml desc = (WebXml) digester.parse(
new File("test/webapp-2.3/WEB-INF/web.xml"));
Assert.assertEquals("2.3", desc.getVersion());
Assert.assertEquals(XmlIdentifiers.WEB_23_PUBLIC, desc.getPublicId());
Assert.assertEquals(0, handler.getErrors().size());
Assert.assertEquals(0, handler.getWarnings().size());
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:15,代码来源:TestSchemaValidation.java
示例9: isServlet22
import org.apache.tomcat.util.descriptor.XmlIdentifiers; //导入依赖的package包/类
/**
* Are we processing a version 2.2 deployment descriptor?
*/
@Override
public boolean isServlet22() {
return XmlIdentifiers.WEB_22_PUBLIC.equals(publicId);
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:8,代码来源:StandardContext.java
示例10: isServlet22
import org.apache.tomcat.util.descriptor.XmlIdentifiers; //导入依赖的package包/类
/**
* Are we processing a version 2.2 deployment descriptor?
*/
@Override
public boolean isServlet22() {
return XmlIdentifiers.WEB_22_PUBLIC.equals(publicId);
}
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:StandardContext.java
注:本文中的org.apache.tomcat.util.descriptor.XmlIdentifiers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论