java»ñÈ¡³ÌÐòµ±Ç°Ä¿Â¼¡£
import java.net.URL;
import java.net.URLDecoder;
public class PathUtil
{
/**
* Get the env of windir, such as "C:\WINDOWS".
* @return the env of windir value.
*/
public static String getWindir(){
return System.getenv("windir");
}
/**
* Get file separator, such as "/" on unix.
*
* @return the separator of file.
*/
public static String getFileSeparator()
{
return System.getProperty("file.separator");
}
/**
* Get line separator, such as "\n" on unix.
*
* @return the separator of line.
*/
public static String getLineSeparator()
{
return System.getProperty("line.separator");
}
/**
* Get programPath
*
* @return programPath
*/
public static String getProgramPath()
{
Class<PathUtil> cls = PathUtil.class;
ClassLoader loader = cls.getClassLoader();
//
// Get the full name of the class.
//
String clsName = cls.getName() + ".class";
//
// Get the package that include the class.
//
Package pack = cls.getPackage();
String path = "";
//
// Transform package name to path.
//
if(pack != null)
{
String packName = pack.getName();
//
// Get the class's file name.
//
clsName = clsName.substring(packName.length() + 1);
//
// If package is simple transform package name to path directly,
// else transform package name to path by package name's
// constituent.
//
path = packName;
if(path.ind
Ïà¹ØÎĵµ£º
public class FindPrime {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int num = 100;
String s = "100ÒÔÄÚµÄËØÊý£º";
for (int i = 1; i <= num; i++) {
int count = 0;
for (int j = 1; j <= (int) Math.s ......
ÏÖÔÚ£¬Ì¸ÔƼÆËãµÄ¿É¶àÁË£¬²»¹ý£¬Ò»°ã±È½Ï¹Ø×¢µÄÊÇGoogleºÍAmazonµÄÔÆ·þÎñ¡£´Ó´ó·¶Î§À´¿´£¬Ò²Ö»ÓÐÕâÁ½¼Ò»ñµÃÁ˹«Öڵĸü¶à¹Ø×¢¡£±ÈÈ磬ÎÒ¸öÈ˺ܸÐÐËȤµÄ£¬¾ÍÊÇGoogleµÄApp EngineʹÓû§Äܹ»ÔÚGoogle»ù´¡ÉèÊ©ÉϹ¹½¨ºÍÍÐ¹Ü Web Ó¦ÓóÌÐò¡£ÖÁÓÚAmazon£¬ËüµÄAmazonWeb Services»¹°üÀ¨Elastic Cloud Compute (EC2)¼ÆËãWeb·þ ......
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
ÔÚtomcatÖз¢²¼webÏîÄ¿£¬¿ÉÄÜÊÇÒòΪspringÖÐÅäÖÃÁËjndi£¨Ö»ÅäÖÃÁËjndi£¬ÆäËûµÄÓй¤¾ß°ü·â×°ÁË£©¡£
Æô¶¯µÄʱºò±¨´í£¨ÔÚÏîĿĿ¼Ï£¬ÔÚtomcatÖÐÅäÖÃcontextÖ¸ÏòÏîĿĿ¼¾ÍûÎÊÌ⣬´ò°ü·¢²¼µ½
tomcat¾Í±¨´íÁË£©£¬Å×µÄÒì³£ÊÇ£º
jav ......
1¡¢ Web.xml
1£© ÅäÖÃhibernate
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dbConnectionContext.xml /WEB-INF/serviceContext.xml</param-value> ......
½üÀ´ÔÚ×öJAVAʱÓõ½ÎļþµÄѹËõÓë½âѹ,ÆäÖÐÅöµ½Á˸öÎÊÌâ:ÏÈÓÃJAVA´úÂë´ò°üºÃµÄJARÎļþ¾¹ýC#µÄzlib´¦Àíºó,¾¹È»²»ÄÜÐÞ¸Ä!
ÍøÉÏÕÒÁ˺ÃЩ´úÂë¶¼²»¿ÉÐÐ,JAVA´´½¨µÄJAR°üÔÚÐ޸ĵÄʱºò¿ÉÒÔ·¢ÏÖ¿ªÊ¼Óиö·¾¶·û'/'»ò'\',ËäÈ»ÔÚ´Ë¿ÉÒÔÐÞ¸ÄJARÎļþ,µ«ÊÇ×ܾõµÃÒþ»¼³öÔÚÕâ,ºóÀ´µÄÊÂÊ ......