You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Mircea Zahan <mz...@level7.ro> on 2001/10/04 08:23:33 UTC

How can I get rid of !DOCTYPE HTML ... header generated by Velocity?

Hello everybody.

I need to build a site which needs only IE compatibility.

So, I need that my generated HTML not to be by the HTML 4.0 standard,
but to use IE's extensions.

Velocity generates the <!DOCTYPE HTML ....> header which tells IE
to conform to the 4.0 standard.

Is there any way I can convince Velocity not to generate it?

Thank you.


Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?

Posted by Bojan Smojver <bo...@binarix.com>.
Mircea Zahan wrote:
> 
> No, I can't, I didn't write the Velocity classes :op
> And modifying the Velocity classes is not a sollution, if that's
> what you suggest.
> 
> Velocity generates the header, you can check that on the
> simplest example you got. Look at the source of the rendered page,
> in the browser.

OK, I admit, I was being a bit of a bastard in my reply ;-)

My point was that Velocity doesn't force you into any such thing -
Velocity can generate Visual Basic (apologies to everyone for using rude
words :-) program code for all it cares about the output. So, if you
could show a bit of code and explain how your app works, that would
really help.

Personally, I use Velocity to serve XHTML. It takes the document from
the file, parses it into AST (I think :-) and during the merge inserts
the values into the resulting document. What's the meat of the document
is totally irrelevant.

I just created this document in one of my applications (named code.vm):

------------------------------------------
This is a totally bogus document $res.encodeURL($req.getRequestURI()).
------------------------------------------

and this is what the browser serves:

------------------------------------------
This is a totally bogus document /code.vm.
------------------------------------------

There are no headers at all...

Bojan

Re: How can I get rid of !DOCTYPE HTML ... header generatedbyVelocity?

Posted by Mircea Zahan <mz...@level7.ro>.
Someone gave me the link bellow. I browsed it and read the doc. I got many things cleared out indeed.
The only one I need to share with you is: you also need to (re)read that doc. With emphasis on "politeness".

http://www.tuxedo.org/~esr/faqs/smart-questions.html

You might be an old one on this mailing list, but that doesn't give you any right to be rude ...
... even if your name is Jon.

Cheers, Jon.

Mircea.


----- Original Message ----- 
From: "Jon Stevens" <jo...@latchkey.com>
To: "velocity-user" <ve...@jakarta.apache.org>
Sent: Thursday, October 04, 2001 8:39 PM
Subject: Re: How can I get rid of !DOCTYPE HTML ... header generatedbyVelocity?


> on 10/4/01 7:17 AM, "Attila Szegedi" <sz...@freemail.hu> wrote:
> 
> > (Folks, don't we want to add a link to this to the Jakarta mailing lists
> > page?)
> > 
> > Attila.
> 
> Clearly my cvs commit message rings true...
> 
> <http://cvs.apache.org/viewcvs.cgi/jakarta-site2/xdocs/site/mail.xml?rev=1.1
> 9&content-type=text/vnd.viewcvs-markup>
> 
> 
> 
> Needless to say, I don't see how someone can come here and imply something
> totally off the wall that they could have simply grep'ed the source code
> for, have someone tell them that it isn't true and then come back and have
> the gall to question that answer by saying:
> 
> "Velocity generates the header, you can check that on the
> simplest example you got. Look at the source of the rendered page,
> in the browser."
> 
> ...and not be called on it...
> 
> -jon


Re: How can I get rid of !DOCTYPE HTML ... header generatedbyVelocity?

Posted by Attila Szegedi <sz...@freemail.hu>.
Hm. I must be suffering from selective blindness...
Attila.

----- Original Message ----- 
From: "Jon Stevens" <jo...@latchkey.com>
To: "velocity-user" <ve...@jakarta.apache.org>
Sent: 2001. október 4. 19:39
Subject: Re: How can I get rid of !DOCTYPE HTML ... header generatedbyVelocity?


> on 10/4/01 7:17 AM, "Attila Szegedi" <sz...@freemail.hu> wrote:
> 
> > (Folks, don't we want to add a link to this to the Jakarta mailing lists
> > page?)
> > 
> > Attila.
> 
> Clearly my cvs commit message rings true...
> 
> <http://cvs.apache.org/viewcvs.cgi/jakarta-site2/xdocs/site/mail.xml?rev=1.1
> 9&content-type=text/vnd.viewcvs-markup>
> 
> 

<snip/>

> 
> -jon
> 
> 

Re: How can I get rid of !DOCTYPE HTML ... header generated byVelocity?

Posted by Jon Stevens <jo...@latchkey.com>.
on 10/4/01 7:17 AM, "Attila Szegedi" <sz...@freemail.hu> wrote:

> (Folks, don't we want to add a link to this to the Jakarta mailing lists
> page?)
> 
> Attila.

Clearly my cvs commit message rings true...

<http://cvs.apache.org/viewcvs.cgi/jakarta-site2/xdocs/site/mail.xml?rev=1.1
9&content-type=text/vnd.viewcvs-markup>



Needless to say, I don't see how someone can come here and imply something
totally off the wall that they could have simply grep'ed the source code
for, have someone tell them that it isn't true and then come back and have
the gall to question that answer by saying:

"Velocity generates the header, you can check that on the
simplest example you got. Look at the source of the rendered page,
in the browser."

...and not be called on it...

-jon


Re: How can I get rid of !DOCTYPE HTML ... header generated byVelocity?

Posted by Attila Szegedi <sz...@freemail.hu>.
Before your cynicism deepens, you really should read
http://www.tuxedo.org/~esr/faqs/smart-questions.html

(Folks, don't we want to add a link to this to the Jakarta mailing lists page?)

Attila.

----- Original Message ----- 
From: "Mircea Zahan" <    >
To: <ve...@jakarta.apache.org>
Sent: 2001. október 4. 12:56
Subject: Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?


> Ok, everybody, I was wrong, it is not the Velocity the one which generates the header.
> 
> But, hey, no one was born with knowledge in the brain ... EXCEPT SOME.
> 
> Anyway, I figured the problem, it is solved, but not thanx to your acid replies.
> 
> "Thank you" and have lots of fun.
> 
> 


Re: How can I get rid of !DOCTYPE HTML ... header generated byVelocity?

Posted by Endre Stølsvik <En...@Stolsvik.com>.
On Thu, 4 Oct 2001, Mircea Zahan wrote:

|
| You're right, mea culpa.
|
| In fact the thing that pissed me off was Jon Stevens' reply.

Now, who DOESN'T get PISSED OFF by _anything_ Jon Stevens' says??

He's an asshole on mailinglists, and I've just joined Velocity! Which he
"owns".. Go Jon - Go Jon - Go JOOOONNNNNNNNNNNNNNNNNNN!!!!!

Apparently he's not that big a dick in real life. At least anybody that
knows him IRL says so. It's just that he hasn't read all those fine
"Netiquette" posts that he so frequently points to himself.
  Like those sections saying something about "DON'T BE A FUCKING ASSHOLE
on a mailinglist", or "DON'T BE A FUCKING WIZ-SHIT on a mailinglist"..

But, hey, he's just one person. Put in a "Jon-Block" in your head, and
he'll go away..

Just for the record: Jon is apparently a very fine coder, he's just not a
very fine email-writer. So if you manage to fine-tune your Jon-Block to
let the essence of his mails reach your consciousness, you could actually
get some useful information out of his shit..


Mvh,
Endre.


Re: How can I get rid of !DOCTYPE HTML ... header generated byVelocity?

Posted by Mircea Zahan <mz...@level7.ro>.
You're right, mea culpa.

In fact the thing that pissed me off was Jon Stevens' reply.

So, I apologize to all the others and thank you for the effort.

I promise not to do it again,
Mircea.



> On 10/4/01 6:56 AM, "Mircea Zahan" <mz...@level7.ro> wrote:
> 
> > Ok, everybody, I was wrong, it is not the Velocity the one which generates the
> > header.
> > 
> > But, hey, no one was born with knowledge in the brain ... EXCEPT SOME.
> > 
> > Anyway, I figured the problem, it is solved, but not thanx to your acid
> > replies.
> > 
> > "Thank you" and have lots of fun.
> 
> 
> Hang on there.  I don't think you are being fair.
> 
> As I see it, the replies were trying to be helpful, for the most part.
> 
> You made the strong statement :
> 
> "Velocity generates the <!DOCTYPE HTML ....> header which tells IE
> to conform to the 4.0 standard.
> 
> Is there any way I can convince Velocity not to generate it?"
> 
> And Bojan said, only 33 minutes later,
> 
> "Can you point to the code that does that?"
> 
> (Which I thought fair, as you stated that 'Velocity generates...')
> 
> You reply was something to the order of 'No, because I didn't write it, and
> I won't modify it.'
> 
> Bojan then 'apologized' for being 'a bastard' (which wasn't the way I read
> it) and then proceeded to give you a helpful reply.
> 
> So, think what you want, but remember that this is a volunteer group, and
> you have all the source code, and you did get your question answered :)
> 
> geir
> 
> 
> -- 
> Geir Magnusson Jr.     geirm@optonline.net
> System and Software Consulting
> "Whoever would overthrow the liberty of a nation must begin by subduing the
> freeness of speech." - Benjamin Franklin
> 


Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 10/4/01 6:56 AM, "Mircea Zahan" <mz...@level7.ro> wrote:

> Ok, everybody, I was wrong, it is not the Velocity the one which generates the
> header.
> 
> But, hey, no one was born with knowledge in the brain ... EXCEPT SOME.
> 
> Anyway, I figured the problem, it is solved, but not thanx to your acid
> replies.
> 
> "Thank you" and have lots of fun.


Hang on there.  I don't think you are being fair.

As I see it, the replies were trying to be helpful, for the most part.

You made the strong statement :

"Velocity generates the <!DOCTYPE HTML ....> header which tells IE
to conform to the 4.0 standard.

Is there any way I can convince Velocity not to generate it?"

And Bojan said, only 33 minutes later,

"Can you point to the code that does that?"

(Which I thought fair, as you stated that 'Velocity generates...')

You reply was something to the order of 'No, because I didn't write it, and
I won't modify it.'

Bojan then 'apologized' for being 'a bastard' (which wasn't the way I read
it) and then proceeded to give you a helpful reply.

So, think what you want, but remember that this is a volunteer group, and
you have all the source code, and you did get your question answered :)

geir


-- 
Geir Magnusson Jr.     geirm@optonline.net
System and Software Consulting
"Whoever would overthrow the liberty of a nation must begin by subduing the
freeness of speech." - Benjamin Franklin



Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?

Posted by Mircea Zahan <mz...@level7.ro>.
Ok, everybody, I was wrong, it is not the Velocity the one which generates the header.

But, hey, no one was born with knowledge in the brain ... EXCEPT SOME.

Anyway, I figured the problem, it is solved, but not thanx to your acid replies.

"Thank you" and have lots of fun.


Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?

Posted by Attila Szegedi <sz...@freemail.hu>.
IE is the stupid here, as in some situations it generates the doctype declaration into the text returned by the "View Source" command. A good example is an empty HTTP response that ends up being
<!DOCTYPE ...>
<HTML>
<BODY>
</BODY>
</HTML>
or something similar.

To summarize: Velocity does not generate the header. IE adds it artificially in certain situations when it thinks the response is HTML.

Attila.

----- Original Message ----- 
From: "Mircea Zahan" <mz...@level7.ro>
To: <ve...@jakarta.apache.org>
Sent: 2001. október 4. 9:14
Subject: Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?


> No, I can't, I didn't write the Velocity classes :op
> And modifying the Velocity classes is not a sollution, if that's
> what you suggest.
> 
> Velocity generates the header, you can check that on the
> simplest example you got. Look at the source of the rendered page,
> in the browser.
> 
> 


Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 10/4/01 3:14 AM, "Mircea Zahan" <mz...@level7.ro> wrote:

> No, I can't, I didn't write the Velocity classes :op
> And modifying the Velocity classes is not a sollution, if that's
> what you suggest.
> 
> Velocity generates the header, you can check that on the
> simplest example you got. Look at the source of the rendered page,
> in the browser.
> 

Just to join in the fun :

Velocity doesn't generate or add any output that wasn't either part of the
input template, or the data objects placed in the context and used in the
template.

It doesn't generate any headers, doesn't know about HTML, etc.
 
Period :)

Geir

> ----- Original Message -----
> From: "Bojan Smojver" <bo...@binarix.com>
> To: <ve...@jakarta.apache.org>
> Sent: Thursday, October 04, 2001 10:00 AM
> Subject: Re: How can I get rid of !DOCTYPE HTML ... header generated by
> Velocity?
> 
> 
>> Mircea Zahan wrote:
>>> 
>>> Hello everybody.
>>> 
>>> I need to build a site which needs only IE compatibility.
>>> 
>>> So, I need that my generated HTML not to be by the HTML 4.0 standard,
>>> but to use IE's extensions.
>>> 
>>> Velocity generates the <!DOCTYPE HTML ....> header which tells IE
>>> to conform to the 4.0 standard.
>> 
>> Can you point to the code that does that?
>> 
>> Bojan
> 

-- 
Geir Magnusson Jr.     geirm@optonline.net
System and Software Consulting
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety." - Benjamin Franklin



Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?

Posted by Jon Stevens <jo...@latchkey.com>.
on 10/4/01 12:14 AM, "Mircea Zahan" <mz...@level7.ro> wrote:

> No, I can't, I didn't write the Velocity classes :op
> And modifying the Velocity classes is not a sollution, if that's
> what you suggest.

grep the source code and tell me where it generates this header.

> Velocity generates the header, you can check that on the
> simplest example you got. Look at the source of the rendered page,
> in the browser.

Don't be stupid. It isn't Velocity generating that header.

Geez...

-jon


Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?

Posted by Mircea Zahan <mz...@level7.ro>.
No, I can't, I didn't write the Velocity classes :op
And modifying the Velocity classes is not a sollution, if that's
what you suggest.

Velocity generates the header, you can check that on the
simplest example you got. Look at the source of the rendered page,
in the browser.


----- Original Message ----- 
From: "Bojan Smojver" <bo...@binarix.com>
To: <ve...@jakarta.apache.org>
Sent: Thursday, October 04, 2001 10:00 AM
Subject: Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?


> Mircea Zahan wrote:
> > 
> > Hello everybody.
> > 
> > I need to build a site which needs only IE compatibility.
> > 
> > So, I need that my generated HTML not to be by the HTML 4.0 standard,
> > but to use IE's extensions.
> > 
> > Velocity generates the <!DOCTYPE HTML ....> header which tells IE
> > to conform to the 4.0 standard.
> 
> Can you point to the code that does that?
> 
> Bojan


Re: How can I get rid of !DOCTYPE HTML ... header generated by Velocity?

Posted by Bojan Smojver <bo...@binarix.com>.
Mircea Zahan wrote:
> 
> Hello everybody.
> 
> I need to build a site which needs only IE compatibility.
> 
> So, I need that my generated HTML not to be by the HTML 4.0 standard,
> but to use IE's extensions.
> 
> Velocity generates the <!DOCTYPE HTML ....> header which tells IE
> to conform to the 4.0 standard.

Can you point to the code that does that?

Bojan