java web applicationÖи÷ÖÖ·¾¶µÄÈ¡µÃ·½·¨
¾³£Íü¼ÇÕâЩ»ù´¡µÄ¶«Î÷£¬¼ÇÏÂÀ´ÁË¡£
ÔÚjspºÍclassÎļþÖе÷ÓõÄÏà¶Ô·¾¶²»Í¬¡£ ÔÚjspÀ¸ùĿ¼ÊÇWebRoot ÔÚclassÎļþÖУ¬¸ùĿ¼ÊÇWebRoot/WEB-INF/classes µ±È»ÄãÒ²¿ÉÒÔÓÃSystem.getProperty("user.dir")»ñÈ¡Ä㹤³ÌµÄ¾ø¶Ô·¾¶¡£
Áí:ÔÚJsp,Servlet,JavaÖÐÏêϸ»ñµÃ·¾¶µÄ·½·¨!
1.jspÖÐÈ¡µÃ·¾¶£º
ÒÔ¹¤³ÌÃûΪTESTΪÀý£º
(1)µÃµ½°üº¬¹¤³ÌÃûµÄµ±Ç°Ò³Ãæȫ·¾¶£ºrequest.getRequestURI()
½á¹û£º/TEST/test.jsp
(2)µÃµ½¹¤³ÌÃû£ºrequest.getContextPath()
½á¹û£º/TEST
(3)µÃµ½µ±Ç°Ò³ÃæËùÔÚĿ¼ÏÂÈ«Ãû³Æ£ºrequest.getServletPath()
½á¹û£ºÈç¹ûÒ³ÃæÔÚjspĿ¼Ï /TEST/jsp/test.jsp
(4)µÃµ½Ò³ÃæËùÔÚ·þÎñÆ÷µÄȫ·¾¶£ºapplication.getRealPath("Ò³Ãæ.jsp")
½á¹û£ºD:\resin\webapps\TEST\test.jsp
(5)µÃµ½Ò³ÃæËùÔÚ·þÎñÆ÷µÄ¾ø¶Ô·¾¶£ºabsPath=new java.io.File(application.getRealPath(request.getRequestURI())).getParent();
½á¹û£ºD:\resin\webapps\TEST
2.ÔÚÀàÖÐÈ¡µÃ·¾¶£º
(1)ÀàµÄ¾ø¶Ô·¾¶£ºClass.class.getClass().getResource("/").getPath()
½á¹û£º/D:/TEST/WebRoot/WEB-INF/classes/pack/
(2)µÃµ½¹¤³ÌµÄ·¾¶£ºSystem.getProperty("user.dir")
½á¹û£ºD:\TEST
3.ÔÚServletÖÐÈ¡µÃ·¾¶£º
(1)µÃµ½¹¤³ÌĿ¼£ºrequest.getSession().getServletContext().getRealPath("") ²ÎÊý¿É¾ßÌåµ½°üÃû¡£
½á¹û£ºE:\Tomcat\webapps\TEST
(2)µÃµ½IEµØÖ·À¸µØÖ·£ºrequest.getRequestURL()
½á¹û£ºhttp://localhost:8080/TEST/test
(3)µÃµ½Ïà¶ÔµØÖ·£ºrequest.getRequestURI()
½á¹û£º/TEST/test
Ïà¹ØÎĵµ£º
Ò»£®POI¼ò½é
Jakarta POI ÊÇapacheµÄ×ÓÏîÄ¿£¬Ä¿±êÊÇ´¦Àíole2¶ÔÏó¡£ËüÌṩÁËÒ»×é²Ù×ÝWindowsÎĵµµÄJava API
Ä¿Ç°±È½Ï³ÉÊìµÄÊÇHSSF½Ó¿Ú£¬´¦ÀíMS Excel£¨97-2002£©¶ÔÏó¡£Ëü²»ÏóÎÒÃǽö½öÊÇÓÃcsvÉú³ÉµÄûÓиñʽµÄ¿ÉÒÔÓÉExcelת»»µÄ¶«Î÷£¬¶øÊÇÕæÕýµÄExcel¶ÔÏó£¬Äã¿ÉÒÔ¿ØÖÆһЩÊôÐÔÈçsheet,cellµÈµÈ¡£
¶þ£®HSSF¸Å¿ö
......
http://java.ccidnet.com/images/java/javagui/index.htm
Õâ¸öÊǽéÉÜjavaµÄgui¸÷¸ö·½ÃæµÄÎÊÌ⣬ÒÔ¼°·¢Õ¹µÄÇ°¾°
SWT, SWING, AWT¸÷×ÔµÄȱµãºÍÓŵ㣬×ܵÃÀ´Ëµ¾ÍÊÇSWTºÜ°ô
http://www.cnblogs.com/pantian/archive/2006/10/30/544584.html
´ÓÍ·¿ªÊ¼°²×°EclipseºÍVE
http://blog.sina.com.cn/s/blog_629c53bd0100gh17.htm ......
JAVAÀà×°ÔØÆ÷classloaderºÍÃüÃû¿Õ¼änamespace
JAVAÐéÄâ»úͨ¹ý×°ÔØ¡¢Á¬½ÓºÍ³õʼ»¯Ò»¸öJAVAÀàÐÍ£¬Ê¹¸ÃÀàÐÍ¿ÉÒÔ±»ÕýÔÚÔËÐеÄJAVA³ÌÐòËùʹÓá£ÆäÖУ¬×°ÔؾÍÊǰѶþ½øÖÆÐÎʽµÄJAVAÀàÐͶÁÈëJAVAÐéÄâ»úÖС£Á¬½Ó¾ÍÊÇ°ÑÕâÖÖÒѾ¶ÁÈëÐéÄâ»úµÄ¶þ½øÖÆÐÎʽµÄÀàÐÍÊý¾ÝºÏ²¢µ½ÐéÄâ»úµÄÔËÐÐʱ״̬ÖÐÈ¥¡£Á¬½Ó½×¶Î·ÖΪÈý¸ö²½Öè£ÑéÖ¤¡¢× ......
String s = new Date().toString();¿ÉÒÔÖ±½Ó´´½¨ÍêжÔÏóºó¾ÍÁ¢¼´ÓÃÆäµÄ·½·¨¡£
Ò»¸ö¶ÔÏó±äÁ¿²¢Ã»ÓÐʵ¼Ê°üº¬Ò»¸ö¶ÔÏ󣬶øÊǽö½öÒýÓÃÒ»¸ö¶ÔÏó¡£
GregorianCalendarÀà
javaÉè¼ÆÕß¾ö¶¨°Ñ±£´æʱ¼äÓë¸øʱ¼äµãÃüÃû·Ö¿ªÀ´£¬ÕâÑù¾ÍÓÐÁ½¸öÀà,dateºÍGregorianCalendar.Ò»¸öÓÃÀ´±íʾʱ¼äµã£¬Ò»¸öÓÃÀ´±íʾ´ó¼ÒÊìϤµÄÈÕÀú±íʾ·¨¡£ÊÂ浃 ......