You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Κώστας Στεργίου <cs...@aias.gr> on 2001/03/22 16:44:12 UTC

What happened to 'default.contentType' property?

Hi,
I am trying to migrate my velocity code from 0.71 to beta 1.0
I can't make velocity work with my encoding (8859_7). Velocity
0.71 had no problem. 

In 0.71, I use to set the following properties:

template.encoding=iso-8859-7
default.contentType=text/html; charset=iso-8859-7

and it worked fine.
Now I see that the default.contentType is not present, and when
I only set the template.encoding, my output is not correct (I get
question marks).

Any help please,
Thanks.



Re: What happened to 'default.contentType' property?

Posted by Jason van Zyl <jv...@apache.org>.
??sta? Ste????? wrote:
> 
> OK, I agree. I am using turbine and you are correct that this is
> a servlet property. BUT:
> Turbine is setting this property correctly but still my Velocity
> template are not correct...

Take the question to the turbine list, and you'll have to be a little
more specific with the problem you're experiencing :-)

-- 
jvz.

Jason van Zyl
jvanzyl@periapt.com

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://tambora.zenplex.org

Re: What happened to 'default.contentType' property?

Posted by Jon Stevens <jo...@latchkey.com>.
on 3/22/01 11:50 AM, "Carl Parrish" <ca...@datasoft.com> wrote:

> You forgot write bad documentation and everyone follows it. :-)

LOL! :-)

Also, it turns out that I was mistaken in my thought about the documentation
of ArrayList...i know i saw it somewhere, i just don't remember where...:-(

anyway, geir added it to the site. thanks geir!

-jon


Re: What happened to 'default.contentType' property?

Posted by Carl Parrish <ca...@datasoft.com>.
You forgot write bad documentation and everyone follows it. :-)

Carl Parrish

Jon Stevens wrote:

> on 3/22/01 9:40 AM, "Geir Magnusson Jr." <ge...@optonline.net> wrote:
> 
> 
>> I am going to document this and put up a FAQ :)
>> 
>> Yes - the Range Operator [1..10] and Object Array ["a","b"]
>> 
>> are ArrayList objects, not Object[]
>> 
>> geir
> 
> 
> It is documented...
> 
> It's funny...don't write documentation and people complain about lacking
> documentation...write good documentation and no one reads it.
> 
> -jon


Re: What happened to 'default.contentType' property?

Posted by Jon Stevens <jo...@latchkey.com>.
on 3/22/01 9:40 AM, "Geir Magnusson Jr." <ge...@optonline.net> wrote:

> I am going to document this and put up a FAQ :)
> 
> Yes - the Range Operator [1..10] and Object Array ["a","b"]
> 
> are ArrayList objects, not Object[]
> 
> geir

It is documented...

It's funny...don't write documentation and people complain about lacking
documentation...write good documentation and no one reads it.

-jon


Re: What happened to 'default.contentType' property?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
??sta? Ste????? wrote:
> 
> Thanks,
> it worked just fine.

and it's now documented.  Thanks for the motivation. :)

geir

> 
> ----- Original Message -----
> From: "Geir Magnusson Jr." <ge...@optonline.net>
> To: <ve...@jakarta.apache.org>
> Sent: Thursday, March 22, 2001 7:40 PM
> Subject: Re: What happened to 'default.contentType' property?
> 
> > ??sta? Ste????? wrote:
> > >
> > > OK, thanks.
> > > Just another question (something that is also seem broken from the 0.71
> > > ver).
> > >
> > > I have a method that accepts an Object[] as an argument. (e.g.
> do(Object[]
> > > param))
> > > When I use VTL to access this method, I write:
> > >
> > > $someobject.do(["astring", "onemore"])
> > > or
> > > $someobject.do([])
> > > to pass an empty Object array.
> > > This does not seem to work with ver. 1.0 byt with 0.71 it was ok.
> > >
> > > Any thoughts?
> >
> > I am going to document this and put up a FAQ :)
> >
> > Yes - the Range Operator [1..10] and Object Array ["a","b"]
> >
> > are ArrayList objects, not Object[]
> >
> > geir
> >
> > --
> > Geir Magnusson Jr.                               geirm@optonline.net
> > Developing for the web?  See http://jakarta.apache.org/velocity/

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

Re: What happened to 'default.contentType' property?

Posted by ??sta? Ste????? <cs...@aias.gr>.
Thanks,
it worked just fine.

----- Original Message -----
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: <ve...@jakarta.apache.org>
Sent: Thursday, March 22, 2001 7:40 PM
Subject: Re: What happened to 'default.contentType' property?


> ??sta? Ste????? wrote:
> >
> > OK, thanks.
> > Just another question (something that is also seem broken from the 0.71
> > ver).
> >
> > I have a method that accepts an Object[] as an argument. (e.g.
do(Object[]
> > param))
> > When I use VTL to access this method, I write:
> >
> > $someobject.do(["astring", "onemore"])
> > or
> > $someobject.do([])
> > to pass an empty Object array.
> > This does not seem to work with ver. 1.0 byt with 0.71 it was ok.
> >
> > Any thoughts?
>
> I am going to document this and put up a FAQ :)
>
> Yes - the Range Operator [1..10] and Object Array ["a","b"]
>
> are ArrayList objects, not Object[]
>
> geir
>
> --
> Geir Magnusson Jr.                               geirm@optonline.net
> Developing for the web?  See http://jakarta.apache.org/velocity/


Re: What happened to 'default.contentType' property?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
??sta? Ste????? wrote:
> 
> OK, thanks.
> Just another question (something that is also seem broken from the 0.71
> ver).
> 
> I have a method that accepts an Object[] as an argument. (e.g. do(Object[]
> param))
> When I use VTL to access this method, I write:
> 
> $someobject.do(["astring", "onemore"])
> or
> $someobject.do([])
> to pass an empty Object array.
> This does not seem to work with ver. 1.0 byt with 0.71 it was ok.
> 
> Any thoughts?

I am going to document this and put up a FAQ :)

Yes - the Range Operator [1..10] and Object Array ["a","b"]

are ArrayList objects, not Object[]

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

Re: What happened to 'default.contentType' property?

Posted by Jason van Zyl <jv...@apache.org>.
??sta? Ste????? wrote:
> 
> OK, thanks.
> Just another question (something that is also seem broken from the 0.71
> ver).
> 
> I have a method that accepts an Object[] as an argument. (e.g. do(Object[]
> param))
> When I use VTL to access this method, I write:
> 
> $someobject.do(["astring", "onemore"])
> or
> $someobject.do([])
> to pass an empty Object array.
> This does not seem to work with ver. 1.0 byt with 0.71 it was ok.

You must change the signature of you method to do(ArrayList).
We changed how the [..] operator works: what is listed inside the
[..] operator is now turned into an ArrayList as opposed to an Object[].

-- 
jvz.

Jason van Zyl
jvanzyl@periapt.com

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://tambora.zenplex.org

Re: What happened to 'default.contentType' property?

Posted by ??sta? Ste????? <cs...@aias.gr>.
OK, thanks.
Just another question (something that is also seem broken from the 0.71
ver).

I have a method that accepts an Object[] as an argument. (e.g. do(Object[]
param))
When I use VTL to access this method, I write:

$someobject.do(["astring", "onemore"])
or
$someobject.do([])
to pass an empty Object array.
This does not seem to work with ver. 1.0 byt with 0.71 it was ok.

Any thoughts?
Thanks

----- Original Message -----
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: <ve...@jakarta.apache.org>
Sent: Thursday, March 22, 2001 7:04 PM
Subject: Re: What happened to 'default.contentType' property?


> Ok - commit is in, and I actually tested that.
>
> We will catch these when we get servlet testing into the testbed using
> J2EEUnit or something.
>
> Thanks, and apologies.
>
> You will need to update your o.a.v.servlet.VelocityServlet.java file and
> rebuild the jar.
>
> geir
>
>
>
> ??sta? Ste????? wrote:
> >
> > OK, I agree. I am using turbine and you are correct that this is
> > a servlet property. BUT:
> > Turbine is setting this property correctly but still my Velocity
> > template are not correct...
> >
>
> --
> Geir Magnusson Jr.                               geirm@optonline.net
> Developing for the web?  See http://jakarta.apache.org/velocity/


Re: What happened to 'default.contentType' property?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Ok - commit is in, and I actually tested that.

We will catch these when we get servlet testing into the testbed using
J2EEUnit or something.

Thanks, and apologies.

You will need to update your o.a.v.servlet.VelocityServlet.java file and
rebuild the jar.

geir



??sta? Ste????? wrote:
> 
> OK, I agree. I am using turbine and you are correct that this is
> a servlet property. BUT:
> Turbine is setting this property correctly but still my Velocity
> template are not correct...
> 

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

Re: What happened to 'default.contentType' property?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Yes - when I moved it, I broke something.  I am fixing it now.  All will
be fine after I commit the fix :)

geir



??sta? Ste????? wrote:
> 
> OK, I agree. I am using turbine and you are correct that this is
> a servlet property. BUT:
> Turbine is setting this property correctly but still my Velocity
> template are not correct...
> 
> ----- Original Message -----
> From: "Geir Magnusson Jr." <ge...@optonline.net>
> To: <ve...@jakarta.apache.org>
> Sent: Thursday, March 22, 2001 6:46 PM
> Subject: Re: What happened to 'default.contentType' property?
> 
> > begone, HTML email :)
> >
> > > Êþóôáò Óôåñãßïõ wrote:
> > >
> > > Hi,
> > > I am trying to migrate my velocity code from 0.71 to beta 1.0
> > > I can't make velocity work with my encoding (8859_7). Velocity
> > > 0.71 had no problem.
> > >
> > > In 0.71, I use to set the following properties:
> > >
> > > template.encoding=iso-8859-7
> > > default.contentType=text/html; charset=iso-8859-7
> > > and it worked fine.
> > > Now I see that the default.contentType is not present, and when
> > > I only set the template.encoding, my output is not correct (I get
> > > question marks).
> >
> > The constant  was moved out of VelocityServlet, as it is a Servlet
> > specific thing, but I see I blew that one too :)  It's not being used in
> > the default impl of setConstantType().
> >
> > Will have that fixed in a jiffy.
> >
> > geir
> >
> >
> > --
> > Geir Magnusson Jr.                               geirm@optonline.net
> > Developing for the web?  See http://jakarta.apache.org/velocity/

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

Re: What happened to 'default.contentType' property?

Posted by ??sta? Ste????? <cs...@aias.gr>.
OK, I agree. I am using turbine and you are correct that this is
a servlet property. BUT:
Turbine is setting this property correctly but still my Velocity
template are not correct...

----- Original Message -----
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: <ve...@jakarta.apache.org>
Sent: Thursday, March 22, 2001 6:46 PM
Subject: Re: What happened to 'default.contentType' property?


> begone, HTML email :)
>
> > Êþóôáò Óôåñãßïõ wrote:
> >
> > Hi,
> > I am trying to migrate my velocity code from 0.71 to beta 1.0
> > I can't make velocity work with my encoding (8859_7). Velocity
> > 0.71 had no problem.
> >
> > In 0.71, I use to set the following properties:
> >
> > template.encoding=iso-8859-7
> > default.contentType=text/html; charset=iso-8859-7
> > and it worked fine.
> > Now I see that the default.contentType is not present, and when
> > I only set the template.encoding, my output is not correct (I get
> > question marks).
>
> The constant  was moved out of VelocityServlet, as it is a Servlet
> specific thing, but I see I blew that one too :)  It's not being used in
> the default impl of setConstantType().
>
> Will have that fixed in a jiffy.
>
> geir
>
>
> --
> Geir Magnusson Jr.                               geirm@optonline.net
> Developing for the web?  See http://jakarta.apache.org/velocity/


Re: What happened to 'default.contentType' property?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
begone, HTML email :)

> Êþóôáò Óôåñãßïõ wrote:
> 
> Hi,
> I am trying to migrate my velocity code from 0.71 to beta 1.0
> I can't make velocity work with my encoding (8859_7). Velocity
> 0.71 had no problem.
> 
> In 0.71, I use to set the following properties:
> 
> template.encoding=iso-8859-7
> default.contentType=text/html; charset=iso-8859-7
> and it worked fine.
> Now I see that the default.contentType is not present, and when
> I only set the template.encoding, my output is not correct (I get
> question marks).

The constant  was moved out of VelocityServlet, as it is a Servlet
specific thing, but I see I blew that one too :)  It's not being used in
the default impl of setConstantType().

Will have that fixed in a jiffy.

geir


-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

Re: What happened to 'default.contentType' property?

Posted by Jason van Zyl <jv...@apache.org>.
> Êþóôáò Óôåñãßïõ wrote:
> 
> Hi,
> I am trying to migrate my velocity code from 0.71 to beta 1.0
> I can't make velocity work with my encoding (8859_7). Velocity
> 0.71 had no problem.
> 
> In 0.71, I use to set the following properties:
> 
> template.encoding=iso-8859-7
> default.contentType=text/html; charset=iso-8859-7
> and it worked fine.
> Now I see that the default.contentType is not present, and when
> I only set the template.encoding, my output is not correct (I get
> question marks).

This is a servlet specific property and has been removed, look
in the VelocityServlet to see how you can set it yourself.

-- 
jvz.

Jason van Zyl
jvanzyl@periapt.com

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://tambora.zenplex.org