Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaÓ¦ÓÃtomcatʵÏÖhttps ssl°²È«Á¬½ÓµÄ·½·¨

ÔÚÕ⿪ʼ֮ǰ£¬ÎÒÃǵÃÏÈÁ˽âÒ»ÏÂʲôÊÇhttps¡£
https (Secure Hypertext Transfer Protocol) = °²È«³¬Îı¾´«ÊäЭÒé
httpsµÄÌصãÊÇ£º
1.Êý¾Ý¼ÓÃÜ£¨SSL£© = Secure Socket Layer
2.Éí·ÝÈÏÖ¤
µ±ÄãµÄÏîÄ¿ÐèÒª¿¼ÂÇ°²È«ÐÔµÄʱºò£¬²¿·ÖÄ£¿é¿ÉÒÔÓõ½https¡£µ±È»ÕâЩ¶¼µÃµ½CA×¢²á£¬ÒªÇ®Ç®µÄŶ¡£
ÕâÀïÎÒÏë¸ø´ó¼Ò½éÉܸö²»Êշѵġ£ÓÃJDKµÄkeytool¹¤¾ßÉú³ÉÖ¤Ê顢ȻºóÔÚTomcatÏÂÅäÖÃserver.xml£¬¾Í¿ÉÒÔʵÏÖhttps£¬¶Ô´«ÊäµÄË«ÏòÊý¾Ý½øÐмÓÃܺͽâÃÜ¡£
 Ë«ÏòµÄ¼ÓÃܽâÃܹý³Ì£º
ÓÃTomcatÀ´ÅäÖÃSSLÖ÷ÒªÓÐÏÂÃæÕâôÁ½´ó²½Ö裺
Ò»¡¢Éú³ÉÖ¤Êé
1.ÔÚÃüÁîÐÐÏÂÖ´ÐУº
%Java_home%\bin\keytool -genkey -alias tomcat -keyalg RSA
ÔÚ´ËÃüÁîÖУ¬keytoolÊÇJDK×Ô´øµÄ²úÉúÖ¤ÊéµÄ¹¤¾ß¡£°ÑRSAÔËËã·¨Ôò×÷ΪÖ÷Òª°²È«ÔËËã·¨Ôò£¬Õâ±£Ö¤ÁËÓëÆäËü·þÎñÆ÷ºÍ×é¼þµÄ¼æÈÝÐÔ¡£
Õâ¸öÃüÁî»áÔÚÓû§µÄhome directory²úÉúÒ»¸ö½Ð×ö" .keystore " µÄÐÂÎļþ¡£ÔÚÖ´Ðкó£¬ÄãÊ×Ïȱ»ÒªÇó³öʾkeystoreÃÜÂë¡£TomcatʹÓõÄĬÈÏÃÜÂëÊÇ" changeit "(È«¶¼ÊÇСд×Öĸ)£¬Èç¹ûÄãÔ¸Ò⣬Äã¿ÉÒÔÖ¸¶¨Äã×Ô¼ºµÄÃÜÂë¡£Ä㻹ÐèÒªÔÚserver.xmlÅäÖÃÎļþÀïÖ¸¶¨×Ô¼ºµÄÃÜÂ룬ÕâÔÚÒÔºó»áÓÐÃèÊö¡£
Èç¹ûÒ»ÇÐ˳Àû£¬ÄãÏÖÔÚ¾ÍÓµÓÐÁËÒ»¸ö¿ÉÒÔ±»ÄãµÄ·þÎñÆ÷ʹÓõÄÓÐÈÏÖ¤ÊéµÄkeystoreÎļþ¡£
¶þ¡¢ÅäÖÃtomcat
µÚ¶þ¸ö´ó²½ÖèÊÇ°Ñsecure socketÅäÖÃÔÚ$CATALINA_HOME/conf/server.xmlÎļþÀï¡£$CATALINA_HOME´ú±í°²×°TomcatµÄĿ¼¡£Ò»¸öÀý×ÓÊÇSSLÁ¬½ÓÆ÷µÄÔªËر»°üÀ¨ÔÚºÍTomcatÒ»Æð°²×°µÄȱʡserver.xmlÎļþÀï¡£Ëü¿´ÆðÀ´ÏóÊÇÕâÑù£º
$CATALINA_HOME/conf/server.xml
< -- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
< !--
< Connector
port="8888" minProcessors="5" maxProcessors="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true";
clientAuth="false" sslProtocol="TLS"/>
-->

ConnectorÔªËر¾Éí£¬ÆäĬÈÏÐÎʽÊDZ»×¢Ê͵ôµÄ(commented out)£¬ËùÒÔÐèÒª°ÑËüÖÜΧµÄ×¢Êͱê־ɾ³ýµô¡£È»ºó£¬¿ÉÒÔ¸ù¾ÝÐèÒª¿Í»§»¯(×Ô¼ºÉèÖÃ)Ìض¨µÄÊôÐÔ¡£Ò»°ãÐèÒªÔö¼ÓÒ»ÏÂkeystoreFileºÍkeystorePassÁ½¸öÊôÐÔ£¬Ö¸¶¨Äã´æ·ÅÖ¤ÊéµÄ·¾¶£¨È磺keystoreFile="D:/shu/.keystore"£©ºÍ¸Õ²ÅÉèÖõÄÃÜÂ루È磺keystorePass="123456"£©¡£
ÔÚÍê³ÉÕâЩÅäÖøü¸Äºó£¬±ØÐëÏóÖØÐÂÆô¶¯Tomcat£¬È»ºóÄã¾Í¿ÉÒÔͨ¹ýSSL·ÃÎÊTomcatÖ§³ÖµÄÈκÎwebÓ¦ÓóÌÐò¡£Ö»²


Ïà¹ØÎĵµ£º

javaÖеÄstringÀàÐÍÈ«Ãæ½âÎö

1. Ê×ÏÈString²»ÊôÓÚ8ÖÖ»ù±¾Êý¾ÝÀàÐÍ£¬StringÊÇÒ»¸ö¶ÔÏó¡£
¡¡¡¡ÒòΪ¶ÔÏóµÄĬÈÏÖµÊÇnull£¬ËùÒÔStringµÄĬÈÏÖµÒ²ÊÇnull£»µ«ËüÓÖÊÇÒ»ÖÖÌØÊâµÄ¶ÔÏó£¬ÓÐÆäËü¶ÔÏóûÓеÄһЩÌØÐÔ¡£
¡¡¡¡2. new String()ºÍnew String(“”)¶¼ÊÇÉêÃ÷Ò»¸öеĿÕ×Ö·û´®£¬ÊÇ¿Õ´®²»ÊÇnull£»
¡¡¡¡3. String str=”kvill”£»
......

java parse excel

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRo ......

JavaÉè¼Æģʽ֮State(״̬ģʽ)

¶¨Ò壺
GOF¡¶Éè¼Æģʽ¡·Öиø״̬ģʽϵĶ¨ÒåΪ£ºÔÊÐíÒ»¸ö¶ÔÏóÔÚÆäÄÚ²¿×´Ì¬¸Ä±äʱ¸Ä±äËüµÄÐÐΪ¡£
ÏÈ¿´Ò»¸öÀý×Ó£º
package com.state;
public class KissingPrincess {
// ±ê־룬±êÖ¾ÊÇÇàÍÜ»¹ÊÇÍõ×Ó¡£
private boolean isFrog = true;
// ¸ù¾ÝisFrog½øÐв»Í¬µÄ²Ù×÷¡£
public void greet() {
if (isFrog)
......

ÔÚOracleÏ¿ª·¢Java³ÌÐòµÄ¾­µäÎÊÌâ½â´ð

 
ÎÊÌâÒ»£ºÈç±£¼ÓÔØJDBCÇý¶¯³ÌÐò£º
 
Õý³£ÎÒÃǼÓÔØÇý¶¯³ÌÐòÓÐÈý¸ö;¾¶£º
 
1.Class.forName(String)ÕâÏëµ±ÓÚclassLoaderÒ»¸öStringÖ¸¶¨µÄÀ࣬ÔÚ×°ÔØʱ°Ñ¸ÃÇý¶¯³ÌÐòµÄ¾²Ì¬ÄÚÈݶ¼³õʼ»¯£¬ÆäʵÕâʱÇý¶¯³ÌÐòÀàµ÷ÓÃÁËDriverManager.registerDriver(driver)·½·¨¡£
 
2.ʹÓÃϵͳÊôÐÔ£ºSystem.getPro ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ