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"/>