Java°æÖ§¸¶±¦½Ó¿Ú¿ª·¢
Java°æÖ§¸¶±¦½Ó¿Ú¿ª·¢
ÐèÇ󣺵÷ÓÃÖ§¸¶±¦½Ó¿ÚµÄ½Ó¿Ú²¢¼¯³Éµ½É̳Ç
µ÷ÓÃÖ§¸¶±¦½Ó¿ÚËùÐèÒªµÄ“Ö§¸¶±¦ºÏ×÷»ï°éid”ºÍ“Ö§¸¶±¦°²È«Ð£ÑéÂ딹«Ë¾¶¼¸øÌṩºÃÁË£¬Ö§¸¶±¦¹Ù·½ÄÇÀïÒ²ÓиýӿڵēʵÎïÉÌÆ·½»Ò×·þÎñ¼¯³É¼¼ÊõÎĵµ”¼°Ïà¹ØµÄDEMOÔ´Âë¡£¹«Ë¾ÈÃÎÒÓÃJAVAÀ´Ð´£¬ÖÕÓÚÔÝʱ²»ÓÃÔÙдJSÁË£¬ºÙºÙ…
ÎĵµÀïҲûʲôÉî°ÂµÄ¶«Î÷£¬¾ÍÊÇһЩ²ÎÊý˵Ã÷Ö®ÀàµÄ£¬±¾Ïë½è×ÅÎĵµºÍDEMOµÄÔ´Â룬Õâ¸ö½Ó¿ÚÎÒÓ¦¸ÃÄܹ»ºÜ¿ì¸ã¶¨µÄ£¬¿ÉûÏëµ½»¹ÊÇ»¨Á˲»ÉÙ¹¦·ò¡£
ËùÓöµ½µÄÎÊÌâ¾ÍÊÇ£¬ÔÚÖ§¸¶±¦ÉÏÃ÷Ã÷Ö§¸¶³É¹¦ÁË£¬µ«ÊÇÌøתµ½É̳ÇÉÏÈ´Ìáʾ½»Ò×ʧ°Ü¡£´ò¿ªDEMOÖеÄalipay_return.jspÎļþ¡£
XML/HTML´úÂë
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.alipay.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
</title>
</head>
<body>
<%
String partner = ""; //partnerºÏ×÷»ï°éid£¨±ØÐëÌîд£©
String privateKey = ""; //partner µÄ¶ÔÓ¦½»Ò×°²È«Ð£ÑéÂ루±ØÐëÌîд£©
//**********************************************************************************
//Èç¹ûÄú·þÎñÆ÷²»Ö§³Öhttps½»»¥£¬¿ÉÒÔʹÓÃhttpµÄÑéÖ¤²éѯµØÖ·
//String alipayNotifyURL = "https://www.alipay.com/cooperate/gateway.do?service=notify_verify"
String alipayNotifyURL = "http://notify.alipay.com/trade/notify_
Ïà¹ØÎĵµ£º
À´Ô´£ºhttp://bbs.hackline.net/thread-3620-1-1.html
Òþ²Ø¾ßÌåʵÏÖÊÇJavaÓïÑÔµÄÖ÷ÒªÌصãÖ®Ò»¡£ÕýÊÇÒòΪÕâ¸öÔÒò£¬ËùÒÔJavaÓïÑÔµÄÒÆÖ²ÐÔ¾ÍÌرðºÃ¡£ÈçÓиö³ÌÐòÔ±±àдÁËÒ»¸öʵÏÖËæ»úÊýµÄ³ÌÐò¿â£¬ÄÇôÆäËû
³ÌÐò¿ª·¢ÈËÔ±Ö»ÐèÒªÖªµÀÕâ¸ö³ÌÐò¿âÐèÒª´«ÈëÄÇЩ²ÎÊý£¬¾Í¿ÉÒÔʹÓÃÕâ¸öÀà¡£ÏÖÔÚÎÞÂÛÊÇÍøÉÏ»¹ÊÇƽʱµÄ¹¤×÷ÖУ¬ÓкܶàÏÖ³É ......
JavaÐéÄâ»úµÄÆðÔ´Óë¹¹Ôì
µ±ÎÒÃÇ˵µ½“Java”Õâ¸ö´ÊµÄʱºò£¬Ö¸µÄÊÇËĸöÏ໥¹ØÁªµÄ¸ÅÄJavaÓïÑÔ¡¢Java API¡¢Java ClassÎļþ¸ñʽ¡¢JavaÐéÄâ»ú¡£Õû¸öJavaÌåϵÊÇ»ùÓÚJava ÐéÄâ»ú¹¹ÔìµÄ£¬ÕýÒòΪÈç´Ë£¬²ÅÄÜʵÏÖJavaµÄ°²È«ÐÔºÍÍøÂçÒƶ¯ÐÔ¡£Java²¢·ÇÊǵÚÒ»¸ö²ÉÓÓÐéÄâ»ú”¸ÅÄîµÄÌåϵ£¬µ«È´ÊǵÚÒ»¸öµÃµ½¹ã·ºÔ ......
ÔÚʹÓÃRegularExpressionValidatorÑéÖ¤¿Ø¼þʱµÄÑéÖ¤¹¦Äܼ°ÆäÑéÖ¤±í´ïʽ½éÉÜÈçÏÂ:
Ö»ÄÜÊäÈëÊý×Ö£º“^[0-9]*$”
Ö»ÄÜÊäÈënλµÄÊý×Ö£º“^d{n}$”
Ö»ÄÜÊäÈëÖÁÉÙnλÊý×Ö£º“^d{n,}$”
Ö»ÄÜÊäÈëm-nλµÄÊý×Ö£º“^d{m,n}$”
Ö»ÄÜÊäÈëÁãºÍ·ÇÁ㿪ͷµÄÊý×Ö£º“^(0|[1- ......
import java.util.regex.*;
public final class RegExpValidator
{
/**
* ÑéÖ¤ÓÊÏä
* @param ´ýÑéÖ¤µÄ×Ö·û´®
* @return Èç¹ûÊÇ·ûºÏµÄ×Ö·û´®,·µ»Ø <b>true </b>,·ñÔòΪ <b>false </b>
*/
public static boolean isEmail(String str)
{ ......
MD5Ëã·¨ÊÇÒ»Öַdz£ÓÅÐãµÄ¼ÓÃÜËã·¨¡£
MD5¼ÓÃÜËã·¨Ìص㣺Áé»îÐÔ¡¢²»¿É»Ö¸´ÐÔ¡£
½éÉÜMD5¼ÓÃÜËã·¨»ù±¾Çé¿öMD5µÄÈ«³ÆÊÇMessage-Digest Algorithm 5£¬ÔÚ90Äê´ú³õÓÉMITµÄ¼ÆËã»ú¿ÆѧʵÑéÊÒºÍRSA Data Security Inc·¢Ã÷£¬¾MD2¡¢MD3ºÍMD4·¢Õ¹¶øÀ´¡£
Message-Digest·ºÖ¸×Ö½Ú´®(Message)µÄHas ......