- 博客(13)
- 收藏
- 关注
原创 spring 静态属性的注入技巧
在用@Autowired自动注入属性的时候,如果属性呗声明为静态的,就会注入失败,报空指针异常。 静态注入的技巧import com.alibaba.fastjson.JSONObject;import com.rongdu.domain.Rule;import com.rongdu.service.Ru
2015-12-02 13:59:01
2508
原创 cron表达式
一、cron表达式的两种格式: Seconds Minutes Hours DayofMonth Month DayofWeek YearSeconds Minutes Hours DayofMonth Month DayofWeek二、每个域可以出现的字符Seconds:可出现", - * /"四个字符,有效范围为0-59的整数 Minut
2015-11-27 13:57:56
669
原创 jpa操作方法介绍
jpa(Java Persistence API)java持久化技术一、persist 将实体加入到持久化上下文中,相当于保存,如果实体已经存在,就报异常。二、merge 将实体加入到持久化上下文中,把一个对象从detach转变为managed,并返回这个对象。当一个对象设置了主键,并调用此方法,就会从数据库中根据主键查找到该对象把它放到
2015-11-26 13:45:42
1335
原创 struts2表单重复提交
一、在页面的form表单中添加令牌属性taglib prefix="s" uri="/struts-tags" %>page contentType="text/html;charset=UTF-8" language="java" %> s:form action="/form/form.action"> s:textfield name="name">s:tex
2015-11-04 23:01:49
446
原创 struts2 ognl表达式
一、#操作符 它的作用有三种1、访问非根对象属性(#session.username)2、用来过滤和投影集合({1,2,3,4,5}.{?#this>2})3、用来构造map(#{"ss":"ss","sss":"sss"})二、%操作符 %用于计算ognl表达式中的值三、$操作符1、在国际化资源中使用og
2015-11-04 22:26:53
376
原创 struts2文件上传下载
一、文件上传1、编写上传页面taglib prefix="s" uri="/struts-tags" %>page contentType="text/html;charset=UTF-8" language="java" %> s:form action="/upload/upload.action" enctype="multipart/form-data">
2015-11-04 21:47:00
467
原创 struts2 The Struts dispatcher cannot be found异常解决办法
HTTP Status 500 - The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its
2015-11-04 21:33:53
702
原创 struts2拦截器
一、编写拦截器public class CustomInterceptor extends AbstractInterceptor { @Override public String intercept(ActionInvocation invocation) throws Exception { String method = invocation.get
2015-11-04 20:52:58
415
原创 struts2国际化支持
一、国际化文件的命名 name_language_country.properties name_language.properties name.properties二、在struts.xml文件中配置国际化支持 name="struts.custom.i18n.resources" value="name
2015-11-04 20:05:10
328
原创 js获取web项目根目录
在web项目中用js获取项目的根目录,ajax请求的时候经常用到!!!!!!function getRootPath(){ //获取当前网址 var curWwwPath=window.document.location.href; //获取主机地址之后的目录 var pathName=window.document.location.pathname;
2015-10-28 09:35:29
894
原创 spring整合hibernate删除和更新方法不管用
自己碰到的解决办法hibernate执行删除或者更新方法需要开启事物,事物提交以后,删除和更新才有效。如果没有配事物,或者事物配置不正确,都会出现这种现象。一般我们为service层配置事物,但是如果有baseService一定要记住为baseService配置事物,用注解和xml配置都行。
2015-10-26 23:13:28
473
原创 jquery插件的扩展
一、封装代码,就是闭包,jquery插件的标准写法 这样写的好处:避免全局依赖避免第三方破坏兼容jquery本身的操作符 “$”和“jQuery”二、编写插件三、使用自己的插件四、运行结果
2015-10-24 18:12:46
395
原创 jquery-dataTables的使用
jquery-dataTables的使用一、jqueryDatatables的下载 http://www.datatables.net/download/packages二、添加css和js文件 三、创建表格,引入文件 {CSDN:CODE:jquery}四、写自己的js文件五、
2015-10-23 21:35:35
480
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人