![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SSH2
zhougaoyun
这个作者很懒,什么都没留下…
展开
-
struts2在action获取表单请求的方式与jquery get参数方式
1、jquery中要在get中传递参数 $(function(){ $.get(url,{username:user,password:pass},function(data){ window.location.href="main.jsp"; }); }); 2、表单 1)[color=red]当把参数作为Action的类属性,且提供属性的getter/sett...原创 2013-11-21 21:08:45 · 156 阅读 · 0 评论 -
spring和hibernate整合后保存不了数据的原因
本人在实现spring和hibernate这和提交数据时出现数据在数据库没有显示出来。数据只提交在缓冲区中没有提交到数据库中。 在hibernate配置文件中增加了这样的 true配置,数据就可以提交上去了。...原创 2013-11-22 14:34:31 · 406 阅读 · 0 评论 -
用spring的事务代理解决事务提交问题
spring事务提理解决事务提交问题有三种方法,这边是提供的是三种方法中的最佳方法: 1)、在dao类中加入事务标注 import org.springframework.transaction.annotation.Transactional; 2)、在applicationContext.xml配置文件中改变成如下: [color=red][/color] ...原创 2013-11-22 14:43:18 · 220 阅读 · 0 评论 -
传递中文参数转换
对于地址后面传递参数为中文值时应该对中文值进行URL编码 发送参数 this.username = URLEncode.encode("中文值","UTF-8"); 接收参数 URLDecoder.decode(new String(request.getparameter("username").getBytes("ISO8859-1"),"UTF-8"),"UTF-8");..原创 2013-11-27 21:05:40 · 384 阅读 · 0 评论 -
表单get提交和post提交乱码问题
get的限制表单的数据集为ASCII码,而Post支持整个ISO10646字符集,默认是用ISO-8859-1,如果不显示的声明method为post,则默认为get,你想get传递的字符集是ASCII当你输入汉字的时候会出现乱码。 request.setCharacterEncoding("UTF-8");这个是只对post方法有用,如果想对get方法有用就在tomcat配置文件server....原创 2013-12-18 16:37:08 · 147 阅读 · 0 评论