- 博客(19)
- 收藏
- 关注
转载 Spring获取WebApplicationcontext,ApplicationContext几种方法详解
方法一:在初始化时保存ApplicationContext对象代码:ApplicationContext ac = new FileSystemXmlApplicationContext("applicationContext.xml");ac.getBean("bean1");说明:这种方式适用于采用Spring框架的独立应用程序,需要程序通过配置文件手工初始化Spring的情况。
2014-02-21 11:58:50
627
转载 js获取某月的最后一天
var date = new Date();var lastOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0);
2013-12-27 16:40:22
614
转载 js获取select选中的option的text
javascriptvar item = document.getElementById("");item.options[item.selectedIndex].text;jQuery$("#selector")[0].options[$("#selector")[0].selectedIndex].text
2013-12-19 16:24:03
1024
原创 xmlrpc简单示例
client端:public class JavaClient { public static void main(String[] args) throws Exception { XmlRpcClientConfigImpl conf = new XmlRpcClientConfigImpl(); conf.setServerURL(new URL("http://1
2013-11-06 00:09:17
794
转载 HttpClient上传文件
public static void main(String args[]) { String targetURL = "http://xxxxxxx"; File targetFile = new File("c:/xx.txt"); PostMethod filePost = new PostMethod(targetURL); try { // 通过以下方法可以模拟
2013-11-02 14:21:06
674
转载 ajaxfileupload带参数上传文件
JQuery的fileupload插件通过动态创建一个iframe并在iframe中创建一个form表单来实现文件上传;而在应用中往往还需要带一些其他的文本参数,而此插件并未提供此功能,需要对源代码进行修改以扩展此功能。jQuery.extend({ createUploadIframe: function(id, uri) { //crea
2013-11-02 14:13:16
948
原创 org.hibernate.LazyInitializationException: could not initialize proxy - no Session
可能原因:Hibernate的OpenSessionInViewFilter放在了Struts的StrutsPrepareAndExecuteFilter后面解决方法:挪到前面即可。 openSessionInViewFilter org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
2013-10-16 09:58:30
857
原创 query specified join fetching, but the owner of the fetched association was not present in the selec
java.lang.IllegalArgumentException: org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list可能的原因:fetch 与 count 一起使用
2013-10-16 09:52:31
1807
原创 当JSTL的<fmt:formatDate/>标签不起作用
当不起作用时,可以在其前面加上" pattern="YYYY-MM-dd HH:mm:ss"/>
2013-10-15 14:02:43
1599
转载 JS汉字转拼音
/*---description: Pinyin, to get chinese pinyin from chinese.license: MIT-styleauthors: Bill Luerequires: core/1.2.1: '*'provides: [Pinyin]... *///(function( window, undefined ){//
2013-09-26 10:21:15
20569
转载 org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
使用原生的SQL查询时,如果你用了text数据类型,Hibernate根本就不认识这种数据类型,所以会返回No Dialect mapping for JDBC type:-1,这样的话,就需要自定义方言。另:如果mysql数据库类型是char,在使用原生SQL查询时,发现结果只取一位字符。解决方法继承MYSQL的dialect,在Hibernate中将CHAR(N)都注册为String类型
2013-09-24 17:56:47
1384
转载 IE和Firefox下载文件名乱码
解决如下: String agent = request.getHeader("USER-AGENT"); if(agent != null && agent.indexOf("MSIE") == -1) {// FF response.setHeader("Content-Disposition", "attachment; filename=" +
2013-09-07 09:35:17
1356
转载 css控制输入法状态
ime-mode : auto | active | inactive | disabled语法取值 auto : 默认值。不影响IME的状态。与不指定 ime-mode 属性时相同 。 active : 指定所有使用IME输入的字符。即激活本地语言输入法。用户仍可以撤销激活IME 。 inactive : 指定所有不使用IME输入的
2013-09-07 09:30:46
814
原创 CentOS 6.4安装JDK
1、下载JDKjdk1.7.0_252、切换为root用户#su -3、创建文件夹#mkdir /usr/java4、拷贝JDK到/usr/java目录下,并解压#cp jdk-7u25-linux-i586.tar.gz /usr/java#cd /usr/java#tar -zxvf jdk-7u25-linux-i586.tar.gz5、设置环境
2013-07-15 00:44:04
662
原创 无意间碰到的乱码问题
如下这样没有问题: this.getResponse().setContentType("text/html"); this.getResponse().setCharacterEncoding("UTF-8"); this.getResponse().setDateHeader("expries", -1); this.getResponse().setHeader("Cach
2013-07-11 11:19:17
754
原创 Tomcat 7.0中使用自定义标签的问题
在Tomcat 6中项目使用自定义标签能正常运行的,放到Tomcat 7中就会出现异常。具体原因暂未研究,通过测试,发现把标签打包成jar文件后可以在Tomcat 7中正常运行。
2013-07-11 10:24:32
828
原创 使用Spring的AOP后,Struts2的@InputConfig注解不起作用
简单解决,使用struts2的通配符,例: /WEB-INF/page/xxx{1}
2013-04-07 11:16:33
1028
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人