tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Spring Scheduled Task is triggered multiple times
Date Sun, 05 Jul 2015 19:21:04 GMT
Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Zoran,
> 
> On 7/3/15 2:41 AM, Zoran Avtarovski wrote:
>> I have a context.xml in the META-INF directory which sets up a db 
>> container and jndi datasource realm, could this be the issue?
>>
>> <?xml version="1.0" encoding="UTF-8"?> <Context URIEncoding="UTF-8"
>> antiResourceLocking="false" path="/pain">
> 
> 
> This is unconnected with your initial problem, but "URIEncoding" isn't
> a valid attribute for <Context>.

And as a didactic interlude, here is why :

1) the standard default character set / encoding on the WWW is (regretably) still 
ISO-8859-1 (otherwise known as iso-latin-1 or simply latin-1). So in the absence of this 
attribute, the request URI would be interpreted by the webserver as encoded in ISO-8859-1.

  The attribute tells the webserver (Tomcat) to interpret the URI instead as being 
Unicode, UTF-8 encoded, which is not the default.

2) The webserver first has to decode the protocol and host and port part of the HTTP 
request.  That tells it (among other things) which <Host> should handle the request.

3) The mapping of the request to a webapp (also known as Context) comes later, within the

<Host>.  And for doing that, the webserver needs to be able to decode and interpret
the 
URI properly, for which it needs to know in which character set / encoding this URI is 
expressed.

At the level of the <Context> thus, this attribute would come "too late", because by
then 
the mapping of the URI to a Context/webapp should already have happened.

That's why "URIEncoding" is an attribute of the <Host> entry, and not the <Context>
entry. 
CQFD.

  Also, your context.xml should never
> contain a "path" attribute for <Context>.
> 

Explained in detail here : 
http://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Common_Attributes
--> path

> You should remove both of these attributes from <Context>.
> 
> - -chris


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message