摘要: 建表语句如下:create table L_LOG_RECORD(LOG_ID number(6) not null primary key,LOG_USER varchar2(50) not null,LOG_OPERATION varchar(50) not null,LOG_OBJECT varchar2(100) not null,LOG_TIME date not null);怎奈,通过Hibernate逆向工程后,生成的实体:package com.idealing.model;import java.sql.Timestamp;import javax.persistence.C 阅读全文
posted @ 2013-06-13 23:01 idealing 阅读(4067) 评论(1) 推荐(0) 编辑
摘要: 首先,要添加ezmorph-1.0.3.jar和morph-1.1.1.jar这两个jar。然后在struts.xml里面,添加json-default<package name="default" extends="struts-default,json-default"><action name="TypeAction_*" class="TypeAction" method="{1}"> <result name ="VIEW_SUCCESS&quo 阅读全文
posted @ 2013-06-13 22:45 idealing 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 在此之前,总以为一个项目里面只要包含了Struts2、Spring和Hibernate的jar就算是一个SSH框架了,现在随着程序编写所遇到的问题,才发现这个想法很可笑,当然,现在的见解也是很肤浅。 之所以会了解到这步,是发现,Struts2和jsp页面交互的数据变量的出现重叠,进而发现action的生命周期是需要设定的,但是无法在Struts.xml里配置,需要在通过Spring来管理,可以annotation也可以xml。 首先,要在web.xml里添加:<listener><listener-class>org.springframework.web.contex 阅读全文
posted @ 2013-06-13 22:28 idealing 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 编写的一个web程序,想通过一个Junit来对其增加用户,这样保持它的相对独立性。 之前使用的是ApplicationContext的方式,来getBean()。之后,配置完spring和struts2,把applicationContext.xml的由src转到WebRoot下的Web-INF中,从而导致ApplicationContext的getbean找不到配置文件,出现空指针的错误。果断想到用spring的注入。但是,直接的注入还是空指针的错误,网上查的说是JUnit是一个框架,Spring是另一个框架,两者之间是独立的,没有上下文关系,若JUnit4中想用Spring的注入的话... 阅读全文
posted @ 2013-06-13 21:25 idealing 阅读(2357) 评论(0) 推荐(0) 编辑