在我的 web.xml 中,我删除了contextConfigLocation
而不是指向application context
我在调度程序 servlet 中定义了我的 bean。这是允许的还是Spring肯定会寻找contextConfigLocation?
<!--context-param> //This part is commented. Is this allowed?
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener-->
通过调度程序 servlet 中的 bean...
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
p:driverClassName="oracle.jdbc.driver.OracleDriver"
p:url="jdbc:oracle:thin:@localhost:1521:Xe"
p:username="hibernate"
p:password="hibernate"></bean>