Posts tagged: spring

升级hibernate版本到3.3.1.GA

项目中使用的hibernate版本是3.2.6.ga,现在需要升级到3.3.1.ga,在集成spring的项目中出现了异常,找不到slf4j的类: Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder 配置最新的slf4j库也不行,hibernate中使用的是1.5.2版本。版本问题解决了,又出现找不到cglib的错误,于是在maven中显式的声明cglib库的依赖。之前是不需要这样显式声明的。 日志引用还是升级到hibernate3.3.1GA的问题    发送文章为PDF   

星期一 十二月 15th, 2008 in , , , , | No Comments »

在spring-dm环境下增加hibernate绑定

在spring-dm(1.1.2)环境下增加hibernate(3.2.6 ga)绑定的步骤:    发送文章为PDF   

星期四 十一月 20th, 2008 in , , , , , , , | No Comments »

通过pax-construct创建spring-dm项目

通过pax-construct创建spring-dm项目,因为借助了maven,所以特别方便。有关pax-construct的准备工作,见:通过pax-construct创建osgi项目。 创建项目: pax-create-project -g com.easymorse.marshal -a spring    发送文章为PDF   

星期二 十一月 4th, 2008 in , , , , , , , | 1 Comment »

spring-dm开发简单的web绑定

spring-dm1.1可支持开发web绑定。基本概念可参考:spring-dm的web支持。以下将在maven创建spring-dm项目和在命令行下运行spring-dm的简单方法涉及的项目基础上,增加web绑定和相关的web支持。 日志引用创建spring-dm和maven驱动的简单webapp    发送文章为PDF   

星期五 十月 31st, 2008 in , , , , , | No Comments »

在命令行下运行spring-dm的简单方法

在spring-dm开发简单的绑定中介绍了编写spring绑定的方法。运行在eclipse环境中。如果需要单独部署,可这样做(不是最优方案,是最简单的): 日志引用spring-dm开发简单的web绑定    发送文章为PDF   

星期一 十月 27th, 2008 in , , , , , , | No Comments »

spring-dm开发简单的绑定

记录一下使用spring-dm、eclipse、maven创建绑定的步骤。 使用环境 jdk 1.6.0_07; eclipse 3.4; maven 2.0.9; spring 2.5.5; spring dm 1.1.2。 日志引用在命令行下运行spring-dm的简单方法    发送文章为PDF   

星期一 十月 27th, 2008 in , , , , | No Comments »

maven创建spring-dm项目

通过maven的spring-osgi-bundle-archetype可快速创建maven项目,比如: mvn archetype:create   -DarchetypeGroupId=org.springframework.osgi   -DarchetypeArtifactId=spring-osgi-bundle-archetype  -DarchetypeVersion=1.1.0   -DgroupId=org.foo  -DartifactId=org.foo.my-springdm-bundle -Dversion=0.1 日志引用spring-dm开发简单的web绑定    发送文章为PDF   

星期一 十月 27th, 2008 in , , , , , , | No Comments »

使用spring security的标签库

有时需要在页面显示用户名,或者根据用户角色显示或者不显示一些内容。这需要使用到spring security提供的标签库。在maven中加入标签库: <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-taglibs</artifactId> <version>2.0.4</version> </dependency>    发送文章为PDF   

星期四 十月 16th, 2008 in , , , | No Comments »

在spring security使用方法保护

spring security可以对链接做权限检查,另外,可以对方法的调用做权限检查。比较简单易行的办法是,通过spring security提供的注解。比如: @RequestMapping("/save.htm") @Secured("ROLE_ADMIN") public ModelAndView save(Product product, BindingResult result) { if (result.hasErrors()) { return new ModelAndView("input"); } this.productDao.saveOrUpdate(product); return new ModelAndView("redirect:/detail.htm", "id", product.getId()); } 这样调用保持product对象的save方法时会检查是否有ROLE_ADMIN角色。如果不符,将返回http 403。    发送文章为PDF   

星期四 十月 16th, 2008 in , , , | No Comments »

spring security中使用对方法的保护需要aspectj

如果在spring security中使用对方法的保护需要使用aspectj的运行环境。在maven中配置方式: <dependency> <groupId>aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.5.4</version> </dependency>    发送文章为PDF   

星期四 十月 16th, 2008 in , , , | No Comments »