velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vitaly Repetenko <...@mtu.ru>
Subject Re: Symbol escaped in a property
Date Thu, 08 Nov 2001 13:00:47 GMT


"Geir Magnusson Jr." wrote:

> On 11/8/01 7:31 AM, "Vitaly Repetenko" <vit@mtu.ru> wrote:
>
> > Good day!
> >
> > "Geir Magnusson Jr." wrote:
> >
> >> On 11/6/01 6:55 AM, "Vitaly Repetenko" <vit@mtu.ru> wrote:
> >>
> >>>>>
> >>>>> configuration.getString("timestampstatement") result is:
> >>>>> select a from t1
> >>>>>
> >>>>> Thanks in advance!
> >>>>> Vitaly
> >>>>
> >>>> I thought we had a problem like this about 6 months ago, and Leon submitted
> >>>> a patch and was applied.  I assume this is a recent version of Velocity?
> >>>
> >>> Velocity Version: Nightly 28 oct. 2001
> >>>
> >>
> >> Heh.  You can't argue that's its old :)
> >>
> >> I need to fix that class anyway, so I will spend some time on it today.
> >
> > It still does not work (commas escaped in properties) :(
> >
> > I have found that it works: select a from a\\\\, b
>
> This dones't make sense :)
>
> We test the configuration stuff in our testbed, and do things with ,'s
>
> Take a look at the CommonsExtPropTestCase in o.a.v.test

I see.
I use Velocity in servlets. May be I do something wrong during loading properties.
In this configuration I can not use escape symbol. :(
It works only when I add \\\\ in a property.
Could you help me?

    protected Properties loadConfiguration(ServletConfig config )
        throws IOException, FileNotFoundException
    {
        Properties p = new Properties();

        String propsFile = config.getInitParameter(INIT_PROPS_KEY);

        if ( propsFile != null )
        {
            String realPath = getServletContext().getRealPath(propsFile);

            if ( realPath != null )
            {
                propsFile = realPath;
            }
        }

        p.load( new FileInputStream(propsFile) );

        return p;
    }

Thanks in advance,
Vitaly


--
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