Json下的Positioned Update not supported解决方法

今天使用json输出的时候报了这个错误,原因找了一下,发现使用hibernate自动生成的一些类会出现这个情况,主要是因为hibernate使用了延迟加载所造成的缘故。 因为我的系统前台使用的jquery-easeyui的dataGrid表格,所以,只能重新建一个类来进行。代码如下 package com.mrzeng.action; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; import org.apache.struts2.convention.annotation.Results; import org.huashui.authentication.AuthName; import org.huashui.dto.PageBean; import org.huashui.service.IPaginate; import org.huashui.util.StringUtils; import org.huashui.util.WebUtils; import com.mrzeng.hibernate.Category; import com.mrzeng.hibernate.Crawlrecord; import com.mrzeng.hibernate.Saleinfo; import com.mrzeng.hibernate.Shop; import com.mrzeng.hibernate.Shopdetail; import com.mrzeng.service.IAnalysisService; /** * @fileName ShopdetailAction.java * @author 曾华水 [...]

Json工具类

jqGrid在处理多字段查询的时候要使用json数据,于是,参考了网上的一些写法,写了一个json工具类。其中那个时间格式化,是为了解决json在处理java的java.util.Date出现的问题。

struts2的action中获得request response session 对象

在struts2中有两种方式可以得到这些对象,一般有两种方式,一种是利用Ioc实现拦截器接口,一种是使用静态类。分布如下

jsp中文验证码

网上找到一个不错的中文验证码,稍微改了改,解决了输出时的报错。还不错。代码如下:

改变Eclipse默认编码

windows –> preferences –> General –> Content types –> Text tree –> Jsp 我们设置最下面的Default Encoding为UTF-8即可.

Struts 2注解实例二

这个例子将继续前面讲的例子

Struts 2注解实例一

本文将通过一个前台通过表单输入user,来实现hello user的方式来讲述Struts2中使用注解。

使用Properties文件来对Log4j进行配置

Log4j will be usually configured using a properties file or xml file externally. So once the log statements are in place you can easily control them using the external configuration file without modifying the source code. Now let’s see how you can obtain the same log output as the previous example using the properties file [...]

简单的Log4j配置

在struts2的网站上看到一个不错的网站:http://www.vaannila.com 看到里面的一些文章很不错。从今天开始陆续翻译一些文章。今天开始翻译Log4j。 Log4j is a simple and flexible logging framework. In this tutorial you will learn how to configure log4j for your applications. Let’s get started first download the latest version of log4j ( Download ). I am using log4j version 1.2.15. Add the log4j-1.2.15.jar to the classpath. Log4j是一个简单而且灵活的日志记录框架,在这教程中,我们将学习到在你的应用中如何对log4j进行配置。首先下载最新的版本log4j(下载)。我使用的是1.2.15版本。将Jar包log4j-1.2.15.jar 加入类路径。 Next you need to create [...]

Hibernate3错误:could not initialize proxy – no Session的解决办法

前段时间在项目中出现以下错误: org.hibernate.LazyInitializationException: could not initialize proxy – no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)