首页 > Spring如何自定义XML标签?

Spring如何自定义XML标签?

有下面这一段代码:

xml<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:jaxrs="http://cxf.apache.org/jaxrs"
    xmlns:beans="http://cxf.apache.org/configuration/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
        http://cxf.apache.org/configuration/beans http://cxf.apache.org/schemas/configuration/cxf-beans.xsd
         http://cxf.apache.org/jaxrs 
         http://cxf.apache.org/schemas/jaxrs.xsd">
 <bean id="helloWorld" class="com.chuanwo.cxfdemo.HelloWorld"></bean>
     <jaxrs:server id="test" address="http://localhost:8080/helloWorld">
       <jaxrs:serviceBeans>
           <ref bean="helloWorld"/>
         </jaxrs:serviceBeans>
     </jaxrs:server>



</beans>

很显然,jaxrs:server是用户自定义的标签。
比如我现在在A公司,我有一套自己的标签。

xml<bean id="helloWorld" class="com.chuanwo.cxfdemo.HelloWorld"></bean>
     <A:Persion id="test" address="http://localhost:8080/helloWorld">
       <jaxrs:serviceBeans>
           <ref bean="helloWorld"/>
         </jaxrs:serviceBeans>
     </A:Persion>

请问要实现这样的需求,我该掌握哪些知识呢?或者要实现这样的功能,该怎么实现呢?


自定义Spring配置标签

【热门文章】
【热门文章】