日期:2014-05-16 浏览次数:20438 次
importPackage( Packages.java.io ); importPackage( Packages.java.util ); fin = new java.io.FileInputStream( new String(params["propFile"]) ); props = new java.util.Properties( ); props.load(fin); extensionProperties.odaURL = new String(props.getProperty("url")); extensionProperties.odaDriverClass = new String(props.getProperty("driver")); extensionProperties.odaUser = new String(props.getProperty("userid")); extensionProperties.odaPassword = new String(props.getProperty("password")); fin.close();?
----------------------------------------
importPackage( Packages.java.io,Packages.java.util,Packages.java.net ); importPackage( Packages.javax.servlet.http ); req = reportContext.getHttpServletRequest( ); propPath = new String(params["propFile"]); if ( propPath.charAt(0) != "/" ) propPath = "/" + propPath; url = req.getSession( ).getServletContext( ).getResource( propPath ); if ( url != null ){ props = new java.util.Properties( ); props.load( url.openStream( ) ); extensionProperties.odaURL = new String(props.getProperty("url")); extensionProperties.odaDriverClass = new String(props.getProperty("driver")); extensionProperties.odaUser = new String(props.getProperty("userid")); extensionProperties.odaPassword = new String(props.getProperty("password")); }