摘要: 今天搞了一上午,都在解决这个问题:org.hibernate.LazyInitializationException: failed to lazily initialize原因很简单,是在非法的session中去调用lazy=“true“的属性,网上资料蛮多的,解决方法有两个1,把lazy=”false“2,在web.xml中加入:(在structs的过滤器之前)hibernateFilterorg.springframework.orm.hibernate.support.OpenSessionInViewFilterhibernateFilter*.do struts2 ... 阅读全文
posted @ 2014-02-18 16:02 QG_Li 阅读(6840) 评论(0) 推荐(0) 编辑
摘要: 1建立HttpConnection,这种连接比较简单,但是是不安全的,网上例子比较多,现在主要说说如果建立HttpsConnection,这种连接时通过SSL协议加密,相对更安全,一般使用这种连接传输用户名密码,等重要信息的,下面看代码:public HttpsURLConnection getHttpsConnection(){ try{ TrustManager[] tm = { new MyX509TrustManager() }; SSLContext sslContext = SSLContext.getInstance("S... 阅读全文
posted @ 2014-02-18 11:08 QG_Li 阅读(1352) 评论(0) 推荐(0) 编辑