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

Java°²È«¹ÜÀíÆ÷Security Manager

    ÿ¸öJavaÓ¦Óö¼¿ÉÒÔÓÐ×Ô¼ºµÄ°²È«¹ÜÀíÆ÷£¬ËüÊÇ·À·¶¶ñÒâ¹¥»÷µÄÖ÷Òª°²È«ÎÀÊ¿¡£°²È«¹ÜÀíÆ÷ͨ¹ýÖ´ÐÐÔËÐн׶μì²éºÍ·ÃÎÊÊÚȨ£¬ÒÔʵʩӦÓÃËùÐèµÄ°²È«²ßÂÔ£¬´Ó¶ø±£»¤×ÊÔ´ÃâÊܶñÒâ²Ù×÷µÄ¹¥»÷¡£Êµ¼ÊÉÏ£¬°²È«¹ÜÀíÆ÷¸ù¾ÝJava°²È«²ßÂÔÎļþ¾ö¶¨½«ÄÄ×éȨÏÞÊÚÓèÀࡣȻ¶ø£¬µ±²»¿ÉÐŵÄÀàºÍµÚÈý·½Ó¦ÓÃʹÓÃJVMʱ£¬Java°²È«¹ÜÀíÆ÷½«Ê¹ÓÃÓëJVMÏà¹ØµÄ°²È«²ßÂÔÀ´Ê¶±ð¶ñÒâ²Ù×÷¡£ÔںܶàÇé¿öÏ£¬ÍþвģÐͲ»°üº¬ÔËÐÐÓÚJVMÖеĶñÒâ´úÂ룬´ËʱJava°²È«¹ÜÀíÆ÷±ã²»ÊDZØÐèµÄ¡£µ±°²È«¹ÜÀíÆ÷¼ì²âµ½Î¥·´°²È«²ßÂԵIJÙ×÷ʱ£¬JVM½«Òý·¢AccessControlException»òSecurityException¡£
    ÔÚJavaÓ¦ÓÃÖУ¬°²È«¹ÜÀíÆ÷ÊÇÓÉSystemÀàÖеķ½·¨setSecurityManagerÉèÖõġ£Òª»ñµÃµ±Ç°µÄ°²È«¹ÜÀíÆ÷£¬¿ÉÒÔʹÓ÷½·¨getSecurityManager¡£
    java.lang.SecurityManagerÀà°üº¬Á˺ܶàcheckXXXX·½·¨£¬ÈçÓÃÓÚÅж϶ÔÎļþ·ÃÎÊȨÏÞµÄcheckRead(String file)·½·¨¡£ÕâЩ¼ì²é·½·¨µ÷ÓÃSecurityManager.checkPermission·½·¨£¬ºóÕ߸ù¾Ý°²È«²ßÂÔÎļþÅжϵ÷ÓÃÓ¦ÓÃÊÇ·ñÓÐÖ´ÐÐËùÇëÇóµÄ²Ù×÷ȨÏÞ¡£Èç¹ûûÓУ¬½«Òý·¢SecurityException¡£
    Èç¹ûÏëÈÃÓ¦ÓÃʹÓð²È«¹ÜÀíÆ÷ºÍ°²È«²ßÂÔ£¬¿ÉÔÚÆô¶¯JVMʱÉ趨-Djava.security.managerÑ¡Ï»¹¿ÉÒÔͬʱָ¶¨°²È«²ßÂÔÎļþ¡£Èç¹ûÔÚÓ¦ÓÃÖÐÆôÓÃÁËJava°²È«¹ÜÀíÆ÷£¬È´Ã»ÓÐÖ¸¶¨°²È«²ßÂÔÎļþ£¬ÄÇôJava°²È«¹ÜÀíÆ÷½«Ê¹ÓÃĬÈϵݲȫ²ßÂÔ£¬ËüÃÇÊÇÓÉλÓÚĿ¼$JAVA_HOME/jre/lib/securityÖеÄjava.policy¶¨ÒåµÄ¡£
¸ÅÄî
²ßÂÔ(Policy)
    Àà×°ÔØÆ÷ÓÃPolicy¶ÔÏó°ïÖúËüÃǾö¶¨£¬°ÑÒ»¶Î´úÂëµ¼ÈëÐéÄâ»úʱӦ¸Ã¸øËüÃÇʲôÑùµÄȨÏÞ. ÈκÎʱºò£¬Ã¿Ò»¸öÓ¦ÓóÌÐò¶¼Ö»ÓÐÒ»¸öPolicy¶ÔÏó.
²ßÂÔÎļþ
    SunµÄjava1.2ƽ̨¾ßÌåµÄPolicy×ÓÀà²ÉÓÃÔÚÒ»ASCII²ßÂÔÎļþÖÐÓÃÉÏÏÂÎÄÎÞ¹ØÎÄ·¨ÃèÊö°²È«²ßÂÔ.
    Ò»¸ö²ßÂÔÎļþ°üÀ¨ÁËһϵÁÐgrant×Ӿ䣬ÿһ¸ögrant×Ӿ佫һЩȨÏÞÊÚ¸øÒ»¸ö´úÂëÀ´Ô´¡£
±£»¤Óò(ProtectionDomain)
    µ±Àà×°ÔØÆ÷½«ÀàÐÍ×°ÈëjavaÐéÄâ»úʱ£¬ËüÃǽ«ÎªÃ¿Ò»¸öÀàÐÍÖ¸ÅÉÒ»¸ö±£»¤Óò£¬±£»¤Óò¶¨ÒåÁËÊÚÓèÒ»¶ÎÌض¨µÄ´úÂëµÄËùÓÐȨÏÞ.×°ÔØÈëjavaÐéÄâ»úµÄÿһ¸öÀàÐͶ¼ÊôÓÚÒ»¸öÇÒ½öÊôÓÚÒ»¸ö±£»¤Óò.
·ÃÎÊ¿ØÖÆÆ÷(AccessController)
    implies()
        ÅжÏÒ»¸öPermissioin¶ÔÏóµÄȨÏÞ£¬ÊÇ·ñÒþº¬(imply)ÔÚÁíÒ»¸öPermissio


Ïà¹ØÎĵµ£º

Java½Ó¿ÚµÄ×÷Óü°ÊµÀý

 -
½üÈÕÔÚ±à³ÌÖÐÓõ½½Ó¿Ú֪ʶ,ÓÉÓڿα¾ÖжԽӿÚÃèÊö½ÏÉÙ,ËùÒÔÏë´ÓÍøÉϲéÕÒ×ÊÁÏ,µ«ÍøÉϵÄ×ÊÁÏ´ó¶àÒ²Ö»ÊÇÈß³¤µÄÃèÊö,ËùÒÔÔÚ´ËÌṩһ×Ô¼ºÐ´µÄʵÀý,¹©´ó¼Ò²Î¿¼:
Ô­ÌâÊÇÕâÑùµÄ£ºÔÚjavaÖУ¬¶¨ÒåÒ»¸ö½Ó¿Ú£¬ÉùÃ÷¼ÆË㳤·½ÐÎÃæ»ýºÍÖܳ¤µÄ³éÏó·½·¨£¬ÔÙÓÃÒ»¸öÀàȥʵÏÖÕâ¸ö½Ó¿Ú£¬ÔÙ±àдһ¸ö²âÊÔÀàȥʹÓÃÕâ¸ö½Ó¿Ú¡£
Ê×ÏÈ£¬½Ó¿Ú±ØÐ ......

Java ÍøÂç³ÌÐò

 JavaÔÚÍøÂç±à³ÌÕâ¸öµØ·½×öµÄºÜºÃ£¬javaµÄÖ÷ҪĿµÄÒ²ÊÇΪÁËÍøÂç¶øÉúµÄ£¬ËüÄÜ·½±ãµÄ·ÃÎÊÍøÂçÉϵÄ×ÊÔ´¡£ÎÒÃÇÕâ½Ú¿ÎÀ´½éÉÜÍøÂçͨѶµÄÁ½ÖÖ»úÖÆ£ºURLͨÐÅ»úÖÆ£¬SocketͨÐÅ»úÖÆ¡£
URL±íʾÁËInternetÉÏÒ»¸ö×ÊÔ´µÄÒýÓûòµØÖ·¡£JavaÍøÂçÓ¦ÓóÌÐòÒ²ÊÇʹÓÃURLÀ´¶¨Î»Òª·ÃÎʵÄInternetµÄ×ÊÔ´¡£ÔÚjdkÀïÃæjava.net.URLÒ²ÊÇÒ»¸öÀ࣬Ëü ......

java jdk5µÄ·ºÐÍÉùÃ÷

 ·ºÐÍÉùÃ÷¾ÍÊÇ·º·ºµÄÉùÃ÷ÀàÐÍ¡£ÎÒÃÇÓÃÆäËüµÄÓïÑÔ×öÒ»¸ö±È½Ï£º
JavascriptÉùÃ÷±äÁ¿£º var i= 1;var c = ‘char ’
VB ÉùÃ÷±äÁ¿£º dim i=1;dim c=’char’
Perl ÉùÃ÷±äÁ¿£º $i = 1; $c = ‘char’
ÕâЩ½Å±¾ÓïÑÔ£¬ÔÚÉùÃ÷±äÁ¿µÄʱºò£¬¸ù±¾¾Í²»ÏëjavaÄÇÑù»¹µÃÉùÃ÷ÀàÐÍ¡£ËûÃǵÄÀàÐÍÒѾ­× ......

treePanel json javaºǫ́

 function createTreeMenu(){//´´½¨Ò»¸öÊ÷µÄÃæ°å
 var treeMenu = new Ext.tree.TreePanel({
  lines : true,
  minSize : 150,
  border : false,
  root : new Ext.tree.AsyncTreeNode({text : 'root'}),
  loader : new Ext.tree.TreeLoader({dataUr ......

javaÖÐ thisÓ÷¨

±ØÐëÓÃthis¹Ø¼ü×ÖµÄÈýÖÖÇé¿ö:
1.ÎÒÃÇÏëͨ¹ý¹¹Ôì·½·¨½«Íⲿ´«ÈëµÄ²ÎÊý¸³Öµ¸ø³ÉÔ±±äÁ¿,¶ø¹¹Ôì·½·¨µÄÐÎʽ²ÎÊýÓëÀà³ÉÔ±µÄ±äÁ¿ÃûÏàͬ,Õâʱ¾ÍÐèÒªthisÕâ¸ö¹Ø¼ü×ÖÀ´Çø±ð¾Ö²¿±äÁ¿ÓëÀà±äÁ¿;
2.¼ÙÉèÓÐÒ»¸öÈÝÆ÷ÀàºÍÒ»¸ö²¿¼þÀà,ÔÚÈÝÆ÷ÀàµÄij¸ö·½·¨ÖÐÒª´´½¨²¿¼þÀàµÄʵÀý¶ÔÏó,¶ø²¿¼þÀàµÄ¹¹Ôì·½·¨Òª½ÓÊÕÒ»¸ö´ú±íÆäËùÔÚÈÝÆ÷µÄ²ÎÊý,ÕâÊ±Ò²Ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ