[Java]struts2-spring整合時配置監聽器

1.struts2-spring整合時配置監聽器web

[在web.xml中]spring

<!-- 上下文載入器監聽器,確保web服務器啓動時,直接完成spring容器的初始化 --/>服務器

[Ctrl + Shift + T 能夠打開 Open type <鍵入contextloader> 能夠找到org.springframework.web.context.ContextLoaderListener] ui

<listener>
    <listener-class>
        org.springframework.web.context.ContextLoaderListener
    </listener-class>
</listener>

<!-- 經過上下文參數配置spring文件的位置 --/>spa

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:beans.xml</param-value>
</context-param>

2.修改struts2的simple主題code

[在struts.xml中]xml

在struts2-core包中,第一個包下面的default.properties中放着struts2的全部常量開發

<!-- 主題 --/>web服務器

<constant name="struts.ui.theme" value="simple"/>

<!-- 開發模式 --/>io

<constant name="struts.devMode" value="true"/>
相關文章
相關標籤/搜索