美文网首页我爱编程
ssh框架中.xml文件小技巧分离xml

ssh框架中.xml文件小技巧分离xml

作者: yingjunchen | 来源:发表于2018-01-02 12:03 被阅读26次

struts.xml文件

struts.xml文件里的action可以分离出来,如:

注: include是放在标签的前面

在src下面新建 package 名为:config.struts,再新建xml文件为warningInformAtion-struts.xml,这样,我们就可以把预警信息监测的action全放在warningInformAtion-struts.xml里面了

warningInformAtion-struts.xml的内容如下:

/next/warningInformation.jsp

applicationContext.xml文件

applicationContext.xml的bean可以分离出来,如:

注:import是放在标签前面的

在src下面新建 package 名为:config.bean,再新建xml文件为warningInformation-bean.xml,这样,我们就可以把预警信息监测的bean全放在warningInformation-bean.xml里面了

warningInformation-bean.xml内容如下:

    xmlns="http://www.springframework.org/schema/beans"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xmlns:p="http://www.springframework.org/schema/p"    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

相关文章

网友评论

    本文标题:ssh框架中.xml文件小技巧分离xml

    本文链接:https://www.haomeiwen.com/subject/qyufnxtx.html