JavaÔÚ²»Í¬»·¾³Ï»ñÈ¡µ±Ç°Â·¾¶µÄ·½·¨
JavaÔÚ²»Í¬»·¾³Ï»ñÈ¡µ±Ç°Â·¾¶µÄ·½·¨
¹Ø¼ü×Ö: javaÔÚ²»Í¬»·¾³Ï»ñÈ¡µ±Ç°Â·¾¶µÄ·½·¨
1. ÔÚServlet\FilterµÈServlet web»·¾³ÖУ¬Ö»Òª»ñµÃjavax.servlet.ServletContextÀàÐÍ£¬Ôò¿ÉÒÔͨ¹ý getRealPath("...") »ñµÃ·¾¶¡£Ïà¶Ô·¾¶ÖÐ×²ãĿ¼¿Éͨ¹ý²ÎÊý“"/"”»ñÈ¡¡£
request.getSession().getServletContext().getRealPath("/");
2. JSP×Ô¶¨Òå±êÇ©javax.servlet.jsp.tagext.TagSupport
((javax.servlet.ServletContext)pageContext).getRealPath("");
3. ÆÕͨJava Class¶ÔÏóÎļþÖÐʹÓãº
this.getClass().getResource("???");
Èç¹ûClassÎļþÔÚ¶¥²ãĿ¼£¨°ü£©ÖУ¬ÇÒ“???”Ϊ¿Õ°××Ö·û´®£¨“""”£©£¬¼°´Ë·½·¨ÔÚjarÎļþÖÐÖ´ÐÐÔò»á·µ»Ønull¡£ÔÚ¶¥²ãĿ¼£¨°ü£©ÒÔϵĸ÷²ãĿ¼£¨°ü£©Ôò»á·µ»Ø°üº¬ÐÒéµÄURL¡£¸÷²ãÎļþ¼Ð£¨°ü£©Ö®¼äʹÓÓ/”·Ö¸ô¡£
ÏîĿλÖãºD:\BeyondTrack--reference\jBPMWebDesigner
javacode λÖãºD:\BeyondTrack--reference\jBPMWebDesigner\build\web\classes\net\java\dev\beyondtrack\web\workflow\designer\japplet
ÎļþλÖãºD:\BeyondTrack--reference\jBPMWebDesigner\src\java\net\java\dev\beyondtrack\web\workflow\designer\icon
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package net.java.dev.beyondtrack.web.workflow.designer.japplet;
import javax.swing.ImageIcon;
/**
*
* @author pub32
*/
public class NewMain {
public NewMain () {
System.out.println(this.getClass().getResource(""));
System.out.println(this.getClass().getResource("."));
System.out.println(this.getClass().getResource(".."));
System.out.println(this.getClass().getResource("/"));
System.out.println(this.getClass().getResource("point.png"));
System.out.println(this.getClass().getResource("/point.png"));
System.out.println(this.getClass().getResource("./point.png"));
System.out.println(this.getClass().getResource("../point.png"));
System.out.println(this.getClass().getResource("icon/point.png"));
System.out.println(this.getClass().getResource("/
Ïà¹ØÎĵµ£º
»¨Á˵ãʱ¼äÈ¥Ñо¿£¬Ò²ËãСÓÐÊÕ»ñ£º
Arrays.sort()·½·¨ÔÚJDKÀïÓкܶ࣬ÆäÖÐ×ÅÖØ˵ÏÂ
static void
sort(Object[] a)
static
<T> void
sort(T[] a, Comparator<? super T> c)
Ç°Õß²ÎÊýÖеÄÊý×éaÖеÄËùÓÐÔªËرØÐëʵÏÖcomparable½Ó¿Ú£¬¿ÉÒÔÖØÔØcomparableµÄ·½·¨compareTo£¨£©¡£
ºóÕß² ......
Èý²½Ñ§»áJava Socket±à³Ì(1)
http://developer.51cto.com 2009-02-04 09:45 ØýÃû Java8 ÎÒÒªÆÀÂÛ(0)
? ÕªÒª£ºËùνsocketͨ³£Ò²³Æ×÷"Ì×½Ó×Ö"£¬ÓÃÓÚÃèÊöIPµØÖ·ºÍ¶Ë¿Ú£¬ÊÇÒ»¸öͨÐÅÁ´µÄ¾ä±ú¡£Ó¦ÓóÌÐòͨ³£Í¨¹ý"Ì×½Ó×Ö"ÏòÍøÂç·¢³öÇëÇó»òÕßÓ¦´ðÍøÂçÇëÇó¡£±¾ÎĽ«Java Socket±à³Ì·ÖΪÈý¸öѧϰ²½Ö裬ÖðÒ ......
javax.swing.plaf.metal.MetalLookAndFeel
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
com.sun.java.swing.plaf.motif.MotifLookAndFeel
com.sun.java.swing.plaf.mac.MacLookAndFeel
com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel //java6ÐÂƤ·ô£¬²£Á§Í¸Ã÷
ÎÒµÄ×ÊÔ´ÖÐÓÐÏà¹Ø java swing ·½ÃæµÄ½Ì³Ì£¬j ......
·ÖÅäÒ³ÃæRole_Right.jspÔÂ룺
<%@ page language="java" isELIgnored="false" pageEncoding="GBK" errorPage="/inc/exception.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<title>½ÇÉ«·ÖÅäȨÏÞ</title>
<!--Áбí--& ......
ÊÂÎñµÄÌØÐÔ£º
1) Ô×ÓÐÔ£¨atomicity£©£ºÊÂÎñÊÇÊý¾Ý¿âµÄÂß¼¹¤×÷µ¥Î»£¬¶øÇÒÊDZØÐëÊÇÔ×Ó¹¤×÷µ¥Î»£¬¶ÔÓÚÆäÊý¾ÝÐ޸ģ¬ÒªÃ´È«²¿Ö´ÐУ¬ÒªÃ´È«²¿²»Ö´ÐС£
2) Ò»ÖÂÐÔ£¨consistency£©£ºÊÂÎñÔÚÍê³Éʱ£¬±ØÐëÊÇËùÓеÄÊý¾Ý¶¼±£³ÖÒ»ÖÂ״̬¡£ÔÚÏà¹ØÊý¾Ý¿âÖУ¬ËùÓйæÔò¶¼±ØÐëÓ¦ÓÃÓÚÊÂÎñµÄÐ޸ģ¬ÒÔ±£³ÖËùÓÐÊý¾ÝµÄÍêÕûÐÔ¡£
3)&n ......