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>

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

阅读 5.4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题