关于spring事务配置
这个问题从一开始困扰了我很久,主要是因为使用HibernateTemplate的时候发生'readOnly‘的问题。之前查了很多资料,都说用spring事务配置可以解决,但之前我都一直没成功。昨天一试,有效果了。
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
&nb...
我的SSH项目之旅(10.session问题的新认识)
记得之前被 session的问题困扰了很久,也不断遇到很多问题,自己也提出许多解决方案,认识在不断加深中....
我把笔记发上来
执行更新update操作时候出现的问题,后台采用hibernateTemplate操作
Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition
OpenSessionInViewFil...
我的SSH项目之旅(9.问题补充)
错误信息收集:
做hibernate表一对一的时候
Exception in thread "main" org.springframework.orm.hibernate3.HibernateSystemException: attempted to assign id from null one-to-one property: person; nested exception is org.hibernate.id.IdentifierGenerationException: attempted to assign id from null one-to-one property: person
org.hibernate.id.IdentifierGenerationException...
我的SSH项目之旅(8.管理员后台)
最后的部分是管理员操作这一部分倒没遇到什么大的问题,一般的问题都可以解决。到是在最后加个登陆验证的过滤器的时候,登陆之后的ID值在有的页面总传不过去,真奇怪。
用户管理|——列出所有用户|——修改用户积分|——删除用户问题管理|——删除问题|——推荐问题栏目管理|——添加|——删除|——修改|——...
我的SSH项目之旅(7.个人中心之分页和Junit测试)
接下来开发个人中心
个人中心包括内容:
1、 修改个人信息
2、 列出我提出的问题
3、 列出我回答过的问题
4、 列出被采纳的问题
分页大概的流程 从后台DAO去数据
public List queryByItem(int itemid, int currentPage, int lineSize)
throws Exception {
// TODO Auto-generated method stub
List all = null;
String h...
我的SSH项目之旅(6.session问题解决)
2008-07-20 22:25:27,531 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
2008-07-20 22:25:27,609 INFO [org.springframework.jdbc.support.SQLErrorCodesFact
ory] - SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL...
我的SSH项目之旅(5.redhat9下环境部署)
来看下面2张表
插入几条测试数据
insert into item value(1,'JAVASE','1');
insert into item value(2,'JAVAEE','2');
insert into subitem(subname,itemid,subcode) value('IO流','1','1');
insert into subitem(subname,itemid,subcode) value('多线程','1','2');
insert into subitem(subname,itemid,subcode) value('socket','1','3');
insert into subitem(subname,itemid,subcode) value(...
我的SSH项目之旅(4.用户登陆及密码操作)
如果出现mysql乱码问题 修改my.ini两处红色的地方gb2312
[client]port=3306[mysql]default-character-set=gb2312# SERVER SECTION# ----------------------------------------------------------------------## The following options will be read by the MySQL Server. Make sure that# you have installed the server correctly (see above) so it reads this # file.#[mysqld]# The TCP/IP Port th...
我的SSH项目之旅(3.用户注册–后台)
以上是做好前台验证,接下来是做DAO接口,往数据库里插数据
UserDAO.java
package dj.fantlam.myssh.dao;
import dj.fantlam.myssh.vo.User;
public interface UserDAO {
//注册
public void register(User user)throws Exception;
}UserDAOImpl.java
package dj.fantlam.myssh.daoimpl;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import dj.fantl...
我的SSH项目之旅(2.用户注册–前台)
user表的结构如下
加入struts
采用DispatchActionStruts-config.xml
Struts-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources /&...