摘要:
/** * @param str * @return */ public static String stringToMD5(String str, String encode) { try { byte[] strTemp = str.getBytes(encode); MessageDigest mdTemp = MessageDigest.getInstance("MD5"); mdTemp.update(strTemp); return toHex... 阅读全文
摘要:
1.HelloWorldpackage reflect.proxy;public interface HelloWorld { void print();}2.HelloWorldImplpackage reflect.proxy;public class HelloWorldImpl implements HelloWorld{ @Override public void print() { // TODO Auto-generated method stub System.out.println("hello world!"); } ... 阅读全文
摘要:
package reflect;import java.lang.reflect.Field;import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;public class InvokeTest { public static Object copy(Object object) throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, I... 阅读全文
摘要:
package search;public class BinarySearch { public static void main(String[] args) { int[] arys = {1, 3, 6, 11, 35, 36, 45, 66, 75}; System.out.println(binarySearch(arys, 6, 0, arys.length - 1)); } private static int binarySearch(int[] arys, int element, int begin, int end) { ... 阅读全文
摘要:
1.encode public static String encode(byte[] bValue, String encode) { ByteArrayOutputStream o = new ByteArrayOutputStream(); byte d[] = new byte[4]; try { int count = 0; for(byte x[] = bValue; count > 2); d[1] = (byte) ((c & 3) > 4... 阅读全文
摘要:
1.创建调用接口@WebServicepublic interface IQueryBusinessService { public @WebResult(name="QueryBusinessReturn") QueryBusinessReturn queryBusinessByBID(@WebParam(name="businessid") String businessid); public @WebResult(name="QueryBusinessReturn") List queryBusinessByCustomer(@ 阅读全文
摘要:
一、常用三个指令 1、if指令 a、 b、 2、list指令 repeatThis 3、include指令 二、处理不存在的变量 1、不存在的变量 a、user不存在则以指定值替代 welcome {user!"jerry"}! b、if指令判断 welcome {user} c、对于多级访问的变量,比如user.name!"jerry",如果user不存在,则会抛出 未定义变量的错误,所以这种情况需要写成(user.name)!"jerry"。 阅读全文
摘要:
1.拦截器中put属性 Message message = PhaseInterceptorChain.getCurrentMessage(); message.put("AuthCode", esbRoute.getAuthCode());2.接口实现中获得MessageContext对象 @Resourceprivate WebServiceContext context; MessageContext ctx = context.getMessageContext(); String ac = (String) ctx.get... 阅读全文
摘要:
1.打开项目根目次下的.project在节点下是否存在 org.eclipse.wst.common.project.facet.core.builder 没有就加上 在节点下是否存在 org.eclipse.wst.common.project.facet.core.nature org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.jem.workbench.JavaEMFNature ... 阅读全文