Tag: spring 3

如何在JSP中使用PropertyPlaceholderConfigurer中指定的属性文件中的属性

在我的应用程序上下文中,我定义了属性文件 我想获得JSP页面上该文件中定义的属性的值。 有没有办法做到这一点 ${something.myProperty}?

找不到当前线程的会话(Spring 3.1.X和Hibernate 4)

我正在尝试使用Spring 3.1和Hibernate 4来设置我的项目。我一直在线学习一些教程。 我得到一个奇怪的错误,根据Spring论坛应该已经修复了Spring 3.1。 春虫追踪器 当我的服务调用getCurrentSession() ,它会抛出以下exception: org.hibernate.HibernateException: **No Session found for current thread**] with root cause org.hibernate.HibernateException: No Session found for current thread at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:97) at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:881) ****编辑:根据Spring Spring 3.1 Documentation for Transactions更新了我的spring-dao.xml。 我尝试用org.apache.commons.dbcp.BasicDataSource交换我的数据源。 我的配置中是否有任何可能导致此问题的属性? **** 这是我的spring-dao.xml: hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect 我的用户bean(User.java) package com.foo.lystra.beans; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; […]