velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Kaufman" <BKauf...@zaplet.com>
Subject RE: VelocityViewServlet and velocity.properties
Date Thu, 03 Oct 2002 14:18:41 GMT
> Does Velocity account for the slashes "/" in paths on 
> different systems?
> I thought for system independence you should not hard-code the "/" and
> should use 'File.separatorChar' instead:

You're right, of course.  But java.io.File can actually handle Unix file paths on all platforms:
"/" is actually portable.  (I'm told it's even required on Mac OS 9, despite the fact that
the Mac OS uses ":" instead of "/".)

The only reason to use File.separator is for file paths you're presenting to the user, which
isn't the case here.

                                                      -- Bill K.


> -----Original Message-----
> From: Kevin Baynes [mailto:kbaynes@seagullsw.com]
> Sent: Thursday, October 03, 2002 6:39 AM
> To: Velocity Users List
> Subject: RE: VelocityViewServlet and velocity.properties
> 
> 
> 
> > Strongly suggest you change it to:
> >
> >        p.setProperty( Velocity.FILE_RESOURCE_LOADER_PATH,  path +
> > "/WEB-INF/web/" );
> 
> One more note:
> 
> Does Velocity account for the slashes "/" in paths on 
> different systems?
> I thought for system independence you should not hard-code the "/" and
> should use 'File.separatorChar' instead:
> 
> p.setProperty( Velocity.FILE_RESOURCE_LOADER_PATH,  path +
> File.separatorChar + "WEB-INF" + File.separatorChar + "web" +
> File.separatorChar );
> 
> and
> 
> p.setProperty( "runtime.log", path + File.separatorChar + 
> "velocity.log" );
> 
> 
> ~k
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:velocity-user-help@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message