yeehya
发贴: 9
积分: 0
|
于 2004-05-20 09:53
public void init() throws ServletException { String strParam = getInitParameter("mapxtremeurl"); if(strParam != null && strParam.length() > 0) mapxtremeurl = strParam; strParam = getInitParameter("imgtype"); if(strParam != null && strParam.length() > 0) imgtype = strParam; strParam = getInitParameter("imgsizex"); if(strParam != null && strParam.length() > 0) imgsizex = (new Integer(strParam)).intValue(); strParam = getInitParameter("imgsizey"); if(strParam != null && strParam.length() > 0) imgsizey = (new Integer(strParam)).intValue(); strParam = getInitParameter("smallimgsizex"); if(strParam != null && strParam.length() > 0) smallimgsizex = (new Integer(strParam)).intValue(); strParam = getInitParameter("smallimgsizey"); if(strParam != null && strParam.length() > 0) smallimgsizey = (new Integer(strParam)).intValue(); strParam = getInitParameter("imgbgcolor"); if(strParam != null && strParam.length() > 0) imgbgcolor = new Color((new Integer(strParam)).intValue()); strParam = getInitParameter("datasource"); if(strParam != null && strParam.length() > 0) datasource = strParam; if(datasource == null) errset("请指定数据源类型"); else if(datasource.equals("oracle")) { strParam = getInitParameter("database"); if(strParam != null && strParam.length() > 0) database = strParam; if(database == null) errset("请指定数据库url"); strParam = getInitParameter("dbusername"); if(strParam != null && strParam.length() > 0) dbusername = strParam; strParam = getInitParameter("dbpassword"); if(strParam != null && strParam.length() > 0) dbpassword = strParam; strParam = getInitParameter("dbtable"); if(strParam != null && strParam.length() > 0) dbtable = strParam; strParam = getInitParameter("dbnamecol"); if(strParam != null && strParam.length() > 0) dbnamecol = strParam; strParam = getInitParameter("dbmapdefcol"); if(strParam != null && strParam.length() > 0) dbmapdefcol = strParam; } else if(datasource.equals("file")) { strParam = getInitParameter("filetype"); if(strParam != null && strParam.length() > 0) filetype = strParam; if(filetype.equals("mdf")) { strParam = getInitParameter("mdfpath"); if(strParam != null && strParam.length() > 0) mdfpath = strParam; if(mdfpath == null) errset("请指定mdf地图定义文件路径"); } else { strParam = getInitParameter("gstpath"); if(strParam != null && strParam.length() > 0) gstpath = strParam; if(gstpath == null) errset("请指定gst地图定义文件路径"); } } strParam = getInitParameter("mapdef"); if(strParam != null && strParam.length() > 0) mapdef = strParam; if(mapdef == null) errset("请指定地图定义名称"); try { MapJ tempmap = initMapJ(); resetpoint = tempmap.getCenter(); resetzoom = tempmap.getZoom(); } catch(Exception e) { e.printStackTrace(); } } 这是servlet中init()是不是有问题呀`?
|