You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2008/05/20 21:26:06 UTC

Setting default content-type in VelocityViewServlet

All,

I have been unable to find the documentation on what property to set to 
change the default content-type set by the VelocityViewServlet (and 
VelocityLayoutServlet). Can someone point me to the right place?

Thanks,
-chris


Re: Setting default content-type in VelocityViewServlet

Posted by Christopher Schultz <ch...@christopherschultz.net>.
All,

Christopher Schultz wrote:
> It's not clear where to set this "property":

While the above statement is true, the one below is not:

> I set 'default.contentType=text/xml' in velocity.properties and the 
> default content type appears not to have changed from the text/html 
> default.

I was editing velocity.properties in the wrong project. :(

It's a crappy day in DC, so my brain isn't working very well. Sorry!

-chris


Re: velocity logging

Posted by Will Glass-Husain <wg...@gmail.com>.
John,

Thanks for letting us know what worked!  In the archives now for those
hitting a similar issue.

WILL

On Wed, May 21, 2008 at 3:33 PM, John Randall <Jo...@parago.com>
wrote:

> I looked in the Log4JLogChute class and found the
> appender.setMaximumFileSize(100000) that explains the file size.  I have
> defined the property runtime.log.logsystem.log4j.logger in
> velocity.properties with my logger and no longer use the runtime.log
> property.  Works like a charm.
>
> -john
>
>
> -----Original Message-----
> From: John Randall [mailto:John.Randall@parago.com]
> Sent: Wednesday, May 21, 2008 4:20 PM
> To: 'Velocity Users List'
> Subject: velocity logging
>
> I just updated to Velocity 1.5 and I am using the Log4JLogChute as my
> logsystem class. I am wanting to use the default configuration.  The issue I
> am having is my velocity.log file max size is around 120KB before it starts
> over.  How can I increase the file size to 25MB using velocity.properties?
>
> Snippet of my velocity.properties file:
> runtime.log.logsystem.class = org.apache.velocity.runtime.log.Log4JLogChute
> runtime.log.invalid.references = false
>
> * Changing this size doesn't seem to help within my application
> runtime.log.logsystem.log4j.file.size=2500000
>
> Thanks,
> John
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

RE: velocity logging

Posted by John Randall <Jo...@parago.com>.
I looked in the Log4JLogChute class and found the appender.setMaximumFileSize(100000) that explains the file size.  I have defined the property runtime.log.logsystem.log4j.logger in velocity.properties with my logger and no longer use the runtime.log property.  Works like a charm.

-john


-----Original Message-----
From: John Randall [mailto:John.Randall@parago.com]
Sent: Wednesday, May 21, 2008 4:20 PM
To: 'Velocity Users List'
Subject: velocity logging

I just updated to Velocity 1.5 and I am using the Log4JLogChute as my logsystem class. I am wanting to use the default configuration.  The issue I am having is my velocity.log file max size is around 120KB before it starts over.  How can I increase the file size to 25MB using velocity.properties?

Snippet of my velocity.properties file:
runtime.log.logsystem.class = org.apache.velocity.runtime.log.Log4JLogChute
runtime.log.invalid.references = false

* Changing this size doesn't seem to help within my application
runtime.log.logsystem.log4j.file.size=2500000

Thanks,
John


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


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


velocity logging

Posted by John Randall <Jo...@parago.com>.
I just updated to Velocity 1.5 and I am using the Log4JLogChute as my logsystem class. I am wanting to use the default configuration.  The issue I am having is my velocity.log file max size is around 120KB before it starts over.  How can I increase the file size to 25MB using velocity.properties?

Snippet of my velocity.properties file:
runtime.log.logsystem.class = org.apache.velocity.runtime.log.Log4JLogChute
runtime.log.invalid.references = false

* Changing this size doesn't seem to help within my application
runtime.log.logsystem.log4j.file.size=2500000

Thanks,
John


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


Re: Setting default content-type in VelocityViewServlet

Posted by Nathan Bubna <nb...@gmail.com>.
On Wed, May 21, 2008 at 6:48 AM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> Nathan,
>
> Nathan Bubna wrote:
>>
>> On Tue, May 20, 2008 at 1:02 PM, Christopher Schultz
>> <ch...@christopherschultz.net> wrote:
>>>
>>> Nathan,
>>>
>>> Nathan Bubna wrote:
>>>>
>>>> not exactly easy to find if you're browsing around, sorry.
>>>
>>> Yeah, not so much. It would be good if there was a collection of
>>> configuration properties, maybe in a table on a web page.
>>
>> That would rock.  wanna help?  if someone got it started, i'd be happy
>> to jump in.
>
> Sure. What's the best way to do that? Wiki? Web page in the site? If the web
> would be better, how do I change stuff there?

Since you can, it's probably best to put it in the distributed docs,
since the wiki is harder to version and distribute.  Just check out
https://svn.apache.org/repos/asf/velocity/tools/trunk and make the
changes in the xdocs there.  You should probably put the table into
the xdocs/view.xml page, since most settings are for all VelocityView
uses (VVS, VLS, and veltag) then perhaps we can add separate tables
(which have links back to the main one) on xdocs/view.servlet.xml for
VVS-specific properties, on xdocs/view.layout.xml for VLS properties.
Veltag is a bit different, as it's specific properties are set via tag
attributes and not velocity.properties or web.xml.  Still, i suppose
we could document those too.

Really, though, the bulk of configuration possibilities are at the
VelocityView level.  So, i'd just start there and not worry about the
rest right away.

> -chris
>
>

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


Re: Setting default content-type in VelocityViewServlet

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Nathan,

Nathan Bubna wrote:
> On Tue, May 20, 2008 at 1:02 PM, Christopher Schultz
> <ch...@christopherschultz.net> wrote:
>> Nathan,
>>
>> Nathan Bubna wrote:
>>> not exactly easy to find if you're browsing around, sorry.
>> Yeah, not so much. It would be good if there was a collection of
>> configuration properties, maybe in a table on a web page.
> 
> That would rock.  wanna help?  if someone got it started, i'd be happy
> to jump in.

Sure. What's the best way to do that? Wiki? Web page in the site? If the 
web would be better, how do I change stuff there?

-chris


Re: Setting default content-type in VelocityViewServlet

Posted by Nathan Bubna <nb...@gmail.com>.
On Tue, May 20, 2008 at 1:02 PM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> Nathan,
>
> Nathan Bubna wrote:
>>
>> not exactly easy to find if you're browsing around, sorry.
>
> Yeah, not so much. It would be good if there was a collection of
> configuration properties, maybe in a table on a web page.

That would rock.  wanna help?  if someone got it started, i'd be happy
to jump in.

> It's not clear where to set this "property":

when in doubt, put it in velocity.properties.  though, yeah, some
things are in web.xml.  hmm.  i suppose we ought to do some
consistifying.

>
> "
> The default implementation is :
>
>    response.setContentType(defaultContentType);
>
>
> where defaultContentType is set to the value of the default.contentType
> property, or "text/html" if that is not set.
> "
>
>
> I set 'default.contentType=text/xml' in velocity.properties and the default
> content type appears not to have changed from the text/html default.
>
> :(
>
> Any suggestions?
>
> -chris
>
>

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


Re: Setting default content-type in VelocityViewServlet

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Nathan,

Nathan Bubna wrote:
> not exactly easy to find if you're browsing around, sorry.

Yeah, not so much. It would be good if there was a collection of 
configuration properties, maybe in a table on a web page.

It's not clear where to set this "property":

"
The default implementation is :

     response.setContentType(defaultContentType);


where defaultContentType is set to the value of the default.contentType 
property, or "text/html" if that is not set.
"


I set 'default.contentType=text/xml' in velocity.properties and the 
default content type appears not to have changed from the text/html default.

:(

Any suggestions?

-chris


Re: Setting default content-type in VelocityViewServlet

Posted by Nathan Bubna <nb...@gmail.com>.
http://velocity.apache.org/tools/releases/1.4/javadoc/org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#setContentType(javax.servlet.http.HttpServletRequest,%20javax.servlet.http.HttpServletResponse)

or

http://velocity.markmail.org/search/default%20content%20type%20VelocityViewServlet?page=1

not exactly easy to find if you're browsing around, sorry.

the default.contentType property works for both Tools 1.x and 2.0.

On Tue, May 20, 2008 at 12:26 PM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> All,
>
> I have been unable to find the documentation on what property to set to
> change the default content-type set by the VelocityViewServlet (and
> VelocityLayoutServlet). Can someone point me to the right place?
>
> Thanks,
> -chris
>
>

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