ITeye博客

bask之家 -- 思则远

bask · 共 56 篇文章

jsp等utf-8处理

(1)修改tomcat/conf/server.xml <Connector port="8080" URIEncoding="utf-8"/> (2)web.xml使用spring CharacterEncodingFilter <filter> <filter-name>encodingFilter</filter-name> <filter-class> org.springframework.web.filter.CharacterEncodingFilter </filter-class> <init-param> <param-name>encoding</param-name>…

2008-08-08 10:38 · java基础 · 评论(0)

ehcache 使用

@Cache --Hibernate二级缓存 @Entity @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Table(name="promotion_info") public class Promotion implements Serializable { //... } 在使用@Cache的时候需要配置ehcache.xml 如下: <?xml version="1.0" encoding="UTF-8"?> <ehcache> <diskStore path="java.io.tmpdir"/> <!-…

2008-08-07 13:04 · Hibernate · 评论(0)

Tomcat的四种基于HTTP协议的Connector性能比较

Tomcat从5.5版本开始,支持以下四种Connector的配置分别为: <Connector port="8081" protocol="org.apache.coyote.http11.Http11NioProtocol" connectionTimeout="20000" redirectPort="8443"/> <Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/> <Connector executor="tomcatThreadPool" port="…

2008-08-06 09:08 · tomcat等 · 评论(0)

ConcurrentModificationException 的解决办法

1.出现 java.util.ConcurrentModificationException 时的解决办法 //(1) 根据某个id直接删除全部(如果数据库中的多对多关系) Set<Largess> largessSet = promotion.getLargess(); largessSet.clear(); //或者 for(Iterator it = largessSet.iterator();it.hasNext();) { Largess largess = (Largess)it.next(); it.remove();//先移除 largessSet.remove(larges…

2008-08-01 11:07 · java基础 · 评论(0)

wicket 简单使用 陆续更新

1. button的 setDefaultFormProcessing(false) 方法可以在表单提交的时候只调用button的onSubmit方法, 当true的情况将先调用form的onSubmit方法再调用button的onSubmit方法,默认为true。 2.在需要的时候增加js public class JQueryValidateBehavior extends AbstractBehavior { private static final ResourceReference JQUERY_VALIDATE = new JavascriptResourceRefernce(J…

2008-08-01 09:18 · Wicket · 评论(0)

滚动显示

此例子也是根据人家修改的 呵呵 公共的css <style type="text/css"> ul,li{margin:0;padding:0} #scrollDiv{width:800px;height:100px;line-height:25px;border:#ccc 1px solid;overflow:hidden} #scrollDiv li{height:25px;padding-left:10px;} </style> 公共的html <div id="scrollDiv"> <ul id="scroll-container" style="margin-top: 0px;"…

2008-07-25 14:25 · jQuery · 评论(0)

打印日历格式

package cn.com.test; import java.util.Calendar; import static java.lang.System.out; public class Demo { static String[] MONTH = new String[]{"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"}; static String[] WEEK = new String[]{"星期日","星期一","星期二","星期三","星期四","星期五","星期六"}; /** * 设置年月返回Ca…

2008-07-16 12:37 · java基础 · 评论(0)

Hibernate 错误总结

1.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class 问题:主要出现在表映射上面,没有关联起来 1> 在配置文件(applicationContext.xml)里没有加入com.bask.model.PromotionItem会出现这个问题 2> 如下: @Entity @Table(name="promotion") public class Promotion implements Serializable { @OneToMany(mappedBy="promotion",…

2008-07-10 13:05 · Hibernate · 评论(2)

spring2.5 及 hibernate annotation 配置文件笔记

1. web.xml 配置 <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/applicationContext.xml <!--classpath*:/spring-config/applicationContext.xml--> </param-value> </context-param> <!-- hibernate open session in view --> <filter> <filter-name>hibernateFilter</filter-na…

2008-07-10 10:43 · Spring · 评论(3)

Hibernate annotation 使用笔记

@Entity --声明为一个实体bean @Table(name="promotion_info") --为实体bean映射指定表(表名="promotion_info) @Id --声明了该实体bean的标识属性 @GeneratedValue --可以定义标识字段的生成策略. @Transient --将忽略这些字段和属性,不用持久化到数据库 @Column(name="promotion_remark")--声明列(字段名="promotion_total") 属性还包括(length=200等) @Temporal(TemporalType.TIMESTAMP)--声明时间格式 @…

2008-07-08 10:41 · Hibernate · 评论(7)

反选 并修改选中的数量

<script> var j=0//全局使用 jQuery(function ($) { //加载触发 $("input[@type='checkbox']").each(function() { if($(this).attr("checked")) { j++; } else { j--; } $("#count").html(""+j); }); $("#count").html(""+j); //反选 $("#otherCheck").click(function(){ j = 0; $("input[@type='checkbox']").each(function() { if(…

2008-07-03 14:13 · jQuery · 评论(0)