ITeye博客

路在何方

tojaoomy · 共 61 篇文章

微信授权打开显示该链接无法访问或白板

最近工作一直忙着微信服务号的开发,头一次,当了一次小白鼠。 微信授权页面打开显示该链接无法访问 首先确定您用的不是测试账号(腾讯测试账号必须关注才能授权),第二,确定您的wifi网络正常。 微信授权页面打开白板 这个问题困扰了很久了,而且只有Android分享给IOS时,打开是白板,最后一步一步的排查,居然是因为中文引起的。在url当中有中文字符,所以给个建议,url中如果有中文,一定要encode,所以,木桶原理大家都懂得,木桶能装多少水,取决最矮的木板。

2014-12-08 17:30 · 评论(0)

Filter,Servlet,Conponent如何获取ApplicationContext

Filter 获取Context 在init()方法获取ServletContext,然后通过WebApplicationContextUtils.getWebApplicationContext(servletContext); public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; ServletContext servletContext = filterConfig.getServletContext(); WebApplicatio…

2014-08-04 18:35 · Java · 评论(0)

在STS下如何配置Location

STS是一个非常好的Eclipse开发工具 默认情况下它是Use workspace metadata(does not modify Tomcat installation) 但是我们希望能部署到Tomcat的安装目录下,如何配置呢? 在我们的Servers View选中要配置的Server版本实例, Please note that : 只有在未部署任何工程的情况下才可更改,否则是不能更改。

2014-04-19 21:57 · Tomcat · 评论(0)

丢失更新

丢失更新 丢失更新(lost update)是一个经典的数据库问题。实际上,所有多用户计算机环境都存在这个问题。 简单地说,出现下面的情况时(按以下所列的顺序),就会发生丢失更新。 (1)会话session1的一个事务获取(查询)一行数据,放入本地内存,显示给用户User1 (2)会话session2另一个事务也获取这一行,但显示给User2 (3)User1使用应用修改了这个一行并提交。session1的事务已经执行 (4)User2也修改这行并提交。session2的事务也执行。 这个过程称为“丢失更新”,因为第(3)步所做的所有修改都会丢失。 解决这个问题,Oracle有2种解决方案 …

2013-11-22 15:56 · Oracle · 评论(1)

Javascript call 方法调用

call 方法是Function对象的方法,因此我们定义的每个函数都拥有该方法。可以通过函数名来调用call方法, call方法的第一个参数会被传递给函数中的this,从第二个参数开始,逐一赋值给函数中的参数。例如: function test(str,str1){ alert(this.name) + ", " + str + ", " + str1); } var object = new Object(); object.name = "hejian"; //test.call 相当于调用了test函数 test.call(object,"hello","world");//将obje…

2013-10-13 22:28 · javascript · 评论(0)

Windows下Mongodb最初未开启认证,如何开启authentication

cmd-> regedit-> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services->MongoDB (mongodb注册的名称,我的是MongoDB) 在它的ImgPath中,我们修改一下,加入 **--**auth 如下 "E:\develop Software\Mongodb\mongodb-win32-x86_64-2.2.3\mongodb-win32-x86_64-2.2.3\bin\mongod.exe" -dbpath "E:\develop Software\Mongodb\mongodb-win32-x86_64-2.…

2013-10-08 22:01 · mongodb · 评论(0)

synchronized (this) 柳暗花明又一村

今天写一个测试类,主要是测试wait(long timeout)到底会不会自动notify,到后来发现 一些很诡异的东西。 package com.hp.thread.chapter04; public class WaitAndNotify { private Object obj = new Object(); public static void testPureWait(){ new Thread(new Runnable(){ public void run() { synchronized (this) { try { System.out.println("thread 0")…

2013-05-17 16:23 · Java · Thread · 评论(7)

同一个线程synchronized方法调用synchronized方法

一个线程里面有两个synchronized方法a(),b(). 假如在a()里面调用b(),会发生什么情况?这样 public synchronized void a(){ ... b() ... } public synchronized void b(){ ... } a()会被hang住吗?

2013-02-21 16:28 · Java · Thread · 评论(1)

GIT初步使用

今天一直在想,怎么可以在Eclipse上把代码托管到像Github或CodeGoogle上, 今天试了一下午,都没有成功(不知道是网络的原因还是什么的,悲催的),无奈只能用命令行使用。以下是 基本步骤: 1.下载Git客户端 Git: http://win.softpedia.com/dyn-search.php?search_term=git&x=0&y=0 SmartGt: http://www.syntevo.com/smartgit/download.html 2.在github注册,“New repository”,完成基本的操作 3.创建密钥,详情参见: https://help…

2012-07-24 16:45 · git · 评论(0)

User Authentication

The Java Authentication and Authorization Service (JAAS) is a part of Java SE 1.4 and beyond. The "authentication" part is concerned with ascertaining the identity of a program user. The "authorization" part maps users to permissions. JAAS is a "pluggable" API that isolates Java applications from t…

2012-05-18 14:35 · Java · Windows · authentication · 评论(0)

Java SSL

一直调查SSL的问题,毫无进展,头疼,先把手头搞定的资料整理下: 网上的资料很多,偷懒一下把。 服务器端代码: package com.ricoh.rits.bct.ssl; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.Unsup…

2012-05-14 16:40 · WebService · Java · SSL · security · 评论(0)

Security Managers and Permissions

Once a class has been loaded into the virtual machine and checked by the verifier, the second security mechanism of the Java platform springs into action: the security manager. The security manager is a class that controls whether a specific operation is permitted. Operations checked by the securit…

2012-05-11 17:44 · Java · security · permission · 评论(0)

[转]Web Services Over SSL - HOW TO

一篇好文章,原文地址: http://www.pankaj-k.net/WSOverSSL/WSOverSSL-HOWTO.html 顺手贴过来,找起来方便 Summary This HOWTO guide explains steps involved in (i) deploying SSL accessible Java Web Services in Servlet based SOAP platforms such as Apache Axis or HP Web Services Platform ( HP-WSP ); and (ii) running Java client …

2012-05-07 15:31 · WebService · Java · SSL · 评论(0)

Getting Started with Python on Heroku/Cedar

Recently,I have nothing to do ,so i help the Japanese investigate some prototype. One was post the MFP(Mutli-Fuctional Printer) statue to the Twitter/Facebook.It was boring. Then i found something interesting follow this. Getting Started with Python on Heroku/Cedar Table of Contents Prerequisites L…

2012-04-20 15:21 · Python · 评论(0)

org.hibernate.HibernateException: No Session found for current thread

Spring3.1.1 Intergrate with Hibernate 4.0.1 occurs the org.hibernate.HibernateException: No Session found for current thread In the applicationContext.xml configuration: this configuration should like this <tx:advice id="txAdvice" transaction-manager="txManager"> <tx:attributes> <tx:method name="ge…

2012-04-01 19:40 · Hibernate · 评论(1)