You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Jeff Schnitzer <je...@infohazard.org> on 2002/06/03 14:42:40 UTC

VelocityViewServlet, properties, and encoding

I seem to be having some difficulty getting VelocityViewServlet to pick
up custom properties.

I'm hoping that by putting:

input.encoding=UTF-8
output.encoding=UTF-8
default.contentType=text/html; charset=utf-8

in a velocity.properties file, the VelocityViewServlet will realize that
UTF-8 is the One True Path and all other encoding schemes are blasphemy.

However, it either doesn't work or somehow it's not picking up the file.
I defined this init-param for the servlet in web.xml:

<init-param>
	<param-name>org.apache.velocity.properties</param-name>
	<param-value>velocity.properties</param-value>
</init-param>

I have tried putting the properties file in both WEB-INF/classes and the
context root (from the code, it looks like the later is correct).  There
is no indication from the logs that it sees my properties, and I'm still
getting ISO-8859-1.

Any advice?

Thanks,
Jeff Schnitzer
jeff@infohazard.org

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: VelocityViewServlet, properties, and encoding

Posted by Bill Boland <bo...@attbi.com>.
Reading your problem helped me solve mine. I had not noticed the
default.contentType velocity property key (as I did not see any
documentation for it). So...it seems to work, if the VelocityServlet can
load the properties.

For my VelocityServlet implementation (which the VelocityViewServlet
extends), my web.xml has the following init-param defined for the
VelocityServlet using the key of just "properties". This seems to work
for me loading this from the /WEB-INF directory.

      <init-param>
        <param-name>properties</param-name>
        <param-value>/WEB-INF/velocity.properties</param-value>
      </init-param>

Hope this helps.

Bill


-----Original Message-----
From: Jeff Schnitzer [mailto:jeff@infohazard.org] 
Sent: Monday, June 03, 2002 5:43 AM
To: Velocity Users List
Subject: VelocityViewServlet, properties, and encoding

I seem to be having some difficulty getting VelocityViewServlet to pick
up custom properties.

I'm hoping that by putting:

input.encoding=UTF-8
output.encoding=UTF-8
default.contentType=text/html; charset=utf-8

in a velocity.properties file, the VelocityViewServlet will realize that
UTF-8 is the One True Path and all other encoding schemes are blasphemy.

However, it either doesn't work or somehow it's not picking up the file.
I defined this init-param for the servlet in web.xml:

<init-param>
	<param-name>org.apache.velocity.properties</param-name>
	<param-value>velocity.properties</param-value>
</init-param>

I have tried putting the properties file in both WEB-INF/classes and the
context root (from the code, it looks like the later is correct).  There
is no indication from the logs that it sees my properties, and I'm still
getting ISO-8859-1.

Any advice?

Thanks,
Jeff Schnitzer
jeff@infohazard.org

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: VelocityViewServlet, properties, and encoding

Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On 6/3/02 8:42 AM, "Jeff Schnitzer" <je...@infohazard.org> wrote:

> I seem to be having some difficulty getting VelocityViewServlet to pick
> up custom properties.
> 
> I'm hoping that by putting:
> 
> input.encoding=UTF-8
> output.encoding=UTF-8
> default.contentType=text/html; charset=utf-8
> 
> in a velocity.properties file, the VelocityViewServlet will realize that
> UTF-8 is the One True Path and all other encoding schemes are blasphemy.
> 
> However, it either doesn't work or somehow it's not picking up the file.
> I defined this init-param for the servlet in web.xml:
> 
> <init-param>
> <param-name>org.apache.velocity.properties</param-name>
> <param-value>velocity.properties</param-value>
> </init-param>
> 
> I have tried putting the properties file in both WEB-INF/classes and the
> context root (from the code, it looks like the later is correct).  There
> is no indication from the logs that it sees my properties, and I'm still
> getting ISO-8859-1.
> 
> Any advice?
> 
> Thanks,
> Jeff Schnitzer
> jeff@infohazard.org
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 

What happens if you try the old key?

-- 
Geir Magnusson Jr.
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>