UTF-8 URI Encoding in grizzly/glassfish

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

UTF-8 URI Encoding in grizzly/glassfish

petercline
Hi all,

I posted this to the glassfish forums and it was suggested that I ask
here.  So, apologies to anyone who is reading this for the second time.

I'm wondering if anyone knows how to configure glassfish to encode URLs
in UTF-8.  I'm considering moving to glassfish from tomcat as a servlet
container (and more later). I'm running solr instances and need to be
able to pass utf-8 encoded characters through the URL. With the default
settings, it's using some other encoding and everything comes back garbled.

In tomcat, I had to add a URIEncoding="UTF-8" attribute to the active
Connector in the server.xml. I can't find any kind of an analog for this
in glassfish, or any other place that seems obvious to specify this.
Thoughts anyone?


Thanks,
Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 URI Encoding in grizzly/glassfish

petercline
I'm not sure how specific this is to grizzly, so I hope I'm not way off
track by posting here.

I found that you can specify a "uriEncoding" property in the
http-listener, which was just what I was looking for. Unfortunately, it
didn't seem to fix the problem as I had anticipated.

 From what I can tell, it doesn't seem to be encoding/decoding the URL
properly. When I pass a query (such as "Eugène") to the servlet, it
doesn't seem to receive it correctly encoded. The response, which (among
other things) simply dumps the GET parameters, is garbled. "Eugène" is
the text I get in the response.

Further, I am fairly confident that the garbling is happening before it
gets to the servlet, because (1) there are no matches, and there would
be if solr (the servlet) got the correct text and (2) the exact same
solr configuration is currently working properly under tomcat using
their Connector. Ideas?

Thanks any help you can offer.

Peter

Peter Cline wrote:

> Hi all,
>
> I posted this to the glassfish forums and it was suggested that I ask
> here. So, apologies to anyone who is reading this for the second time.
>
> I'm wondering if anyone knows how to configure glassfish to encode
> URLs in UTF-8. I'm considering moving to glassfish from tomcat as a
> servlet container (and more later). I'm running solr instances and
> need to be able to pass utf-8 encoded characters through the URL. With
> the default settings, it's using some other encoding and everything
> comes back garbled.
>
> In tomcat, I had to add a URIEncoding="UTF-8" attribute to the active
> Connector in the server.xml. I can't find any kind of an analog for
> this in glassfish, or any other place that seems obvious to specify
> this. Thoughts anyone?
>
>
> Thanks,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 URI Encoding in grizzly/glassfish

Jesper Söderlund
Could it have something to do with the default encoding of the JVM? I remember having to specify an 8-bit default charset in some environments to get it working, e.g. -Dfile.encoding=ISO-8859-1

2008/3/13, Peter Cline <[hidden email]>:
I'm not sure how specific this is to grizzly, so I hope I'm not way off
track by posting here.

I found that you can specify a "uriEncoding" property in the
http-listener, which was just what I was looking for. Unfortunately, it
didn't seem to fix the problem as I had anticipated.

From what I can tell, it doesn't seem to be encoding/decoding the URL
properly. When I pass a query (such as "Eugène") to the servlet, it
doesn't seem to receive it correctly encoded. The response, which (among
other things) simply dumps the GET parameters, is garbled. "Eugène" is
the text I get in the response.

Further, I am fairly confident that the garbling is happening before it
gets to the servlet, because (1) there are no matches, and there would
be if solr (the servlet) got the correct text and (2) the exact same
solr configuration is currently working properly under tomcat using
their Connector. Ideas?

Thanks any help you can offer.

Peter

Peter Cline wrote:
> Hi all,
>
> I posted this to the glassfish forums and it was suggested that I ask
> here. So, apologies to anyone who is reading this for the second time.
>
> I'm wondering if anyone knows how to configure glassfish to encode
> URLs in UTF-8. I'm considering moving to glassfish from tomcat as a
> servlet container (and more later). I'm running solr instances and
> need to be able to pass utf-8 encoded characters through the URL. With
> the default settings, it's using some other encoding and everything
> comes back garbled.
>
> In tomcat, I had to add a URIEncoding="UTF-8" attribute to the active
> Connector in the server.xml. I can't find any kind of an analog for
> this in glassfish, or any other place that seems obvious to specify
> this. Thoughts anyone?
>
>
> Thanks,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 URI Encoding in grizzly/glassfish

Jesper Söderlund
Sorry, should have been more specific. I have not tried or made this work with GF, only in "good 'ol tomcat".

2008/3/13, Jesper Söderlund <[hidden email]>:
Could it have something to do with the default encoding of the JVM? I remember having to specify an 8-bit default charset in some environments to get it working, e.g. -Dfile.encoding=ISO-8859-1

2008/3/13, Peter Cline <[hidden email]>:
I'm not sure how specific this is to grizzly, so I hope I'm not way off
track by posting here.

I found that you can specify a "uriEncoding" property in the
http-listener, which was just what I was looking for. Unfortunately, it
didn't seem to fix the problem as I had anticipated.

From what I can tell, it doesn't seem to be encoding/decoding the URL
properly. When I pass a query (such as "Eugène") to the servlet, it
doesn't seem to receive it correctly encoded. The response, which (among
other things) simply dumps the GET parameters, is garbled. "Eugène" is
the text I get in the response.

Further, I am fairly confident that the garbling is happening before it
gets to the servlet, because (1) there are no matches, and there would
be if solr (the servlet) got the correct text and (2) the exact same
solr configuration is currently working properly under tomcat using
their Connector. Ideas?

Thanks any help you can offer.

Peter

Peter Cline wrote:
> Hi all,
>
> I posted this to the glassfish forums and it was suggested that I ask
> here. So, apologies to anyone who is reading this for the second time.
>
> I'm wondering if anyone knows how to configure glassfish to encode
> URLs in UTF-8. I'm considering moving to glassfish from tomcat as a
> servlet container (and more later). I'm running solr instances and
> need to be able to pass utf-8 encoded characters through the URL. With
> the default settings, it's using some other encoding and everything
> comes back garbled.
>
> In tomcat, I had to add a URIEncoding="UTF-8" attribute to the active
> Connector in the server.xml. I can't find any kind of an analog for
> this in glassfish, or any other place that seems obvious to specify
> this. Thoughts anyone?
>
>
> Thanks,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 URI Encoding in grizzly/glassfish

petercline
Well, it was certainly worth a shot.  I tried prepending that (but with
UTF-8) to the actual java call made in the server startup script.  But
upon restarting the server, no change.

Thanks for the suggestion.

Peter

Jesper Söderlund wrote:

> Sorry, should have been more specific. I have not tried or made this
> work with GF, only in "good 'ol tomcat".
>
> 2008/3/13, Jesper Söderlund <[hidden email]
> <mailto:[hidden email]>>:
>
>     Could it have something to do with the default encoding of the
>     JVM? I remember having to specify an 8-bit default charset in some
>     environments to get it working, e.g. -Dfile.encoding=ISO-8859-1
>
>     2008/3/13, Peter Cline <[hidden email]
>     <mailto:[hidden email]>>:
>
>         I'm not sure how specific this is to grizzly, so I hope I'm
>         not way off
>         track by posting here.
>
>         I found that you can specify a "uriEncoding" property in the
>         http-listener, which was just what I was looking for.
>         Unfortunately, it
>         didn't seem to fix the problem as I had anticipated.
>
>         From what I can tell, it doesn't seem to be encoding/decoding
>         the URL
>         properly. When I pass a query (such as "Eugène") to the
>         servlet, it
>         doesn't seem to receive it correctly encoded. The response,
>         which (among
>         other things) simply dumps the GET parameters, is garbled.
>         "EugeÌ€ne" is
>         the text I get in the response.
>
>         Further, I am fairly confident that the garbling is happening
>         before it
>         gets to the servlet, because (1) there are no matches, and
>         there would
>         be if solr (the servlet) got the correct text and (2) the
>         exact same
>         solr configuration is currently working properly under tomcat
>         using
>         their Connector. Ideas?
>
>         Thanks any help you can offer.
>
>         Peter
>
>         Peter Cline wrote:
>         > Hi all,
>         >
>         > I posted this to the glassfish forums and it was suggested
>         that I ask
>         > here. So, apologies to anyone who is reading this for the
>         second time.
>         >
>         > I'm wondering if anyone knows how to configure glassfish to
>         encode
>         > URLs in UTF-8. I'm considering moving to glassfish from
>         tomcat as a
>         > servlet container (and more later). I'm running solr
>         instances and
>         > need to be able to pass utf-8 encoded characters through the
>         URL. With
>         > the default settings, it's using some other encoding and
>         everything
>         > comes back garbled.
>         >
>         > In tomcat, I had to add a URIEncoding="UTF-8" attribute to
>         the active
>         > Connector in the server.xml. I can't find any kind of an
>         analog for
>         > this in glassfish, or any other place that seems obvious to
>         specify
>         > this. Thoughts anyone?
>         >
>         >
>         > Thanks,
>         > Peter
>         >
>         > ---------------------------------------------------------------------
>         > To unsubscribe, e-mail:
>         [hidden email]
>         <mailto:[hidden email]>
>         > For additional commands, e-mail:
>         [hidden email]
>         <mailto:[hidden email]>
>         >
>
>         ---------------------------------------------------------------------
>         To unsubscribe, e-mail: [hidden email]
>         <mailto:[hidden email]>
>         For additional commands, e-mail:
>         [hidden email]
>         <mailto:[hidden email]>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 URI Encoding in grizzly/glassfish

Jeanfrancois Arcand-2
In reply to this post by petercline
Hi Peter,

Peter Cline wrote:
> I'm not sure how specific this is to grizzly, so I hope I'm not way off
> track by posting here.

It is a GlassFish issue, not Grizzly :-)

>
> I found that you can specify a "uriEncoding" property in the
> http-listener, which was just what I was looking for. Unfortunately, it
> didn't seem to fix the problem as I had anticipated.
>
>  From what I can tell, it doesn't seem to be encoding/decoding the URL
> properly. When I pass a query (such as "Eugène") to the servlet, it
> doesn't seem to receive it correctly encoded. The response, which (among
> other things) simply dumps the GET parameters, is garbled. "Eugène" is
> the text I get in the response.
>
> Further, I am fairly confident that the garbling is happening before it
> gets to the servlet, because (1) there are no matches, and there would
> be if solr (the servlet) got the correct text and (2) the exact same
> solr configuration is currently working properly under tomcat using
> their Connector. Ideas?

Let me take a look and try to come back before the end of the day.


>
> Thanks any help you can offer.

A+

-- jeanfrancois


>
> Peter
>
> Peter Cline wrote:
>> Hi all,
>>
>> I posted this to the glassfish forums and it was suggested that I ask
>> here. So, apologies to anyone who is reading this for the second time.
>>
>> I'm wondering if anyone knows how to configure glassfish to encode
>> URLs in UTF-8. I'm considering moving to glassfish from tomcat as a
>> servlet container (and more later). I'm running solr instances and
>> need to be able to pass utf-8 encoded characters through the URL. With
>> the default settings, it's using some other encoding and everything
>> comes back garbled.
>>
>> In tomcat, I had to add a URIEncoding="UTF-8" attribute to the active
>> Connector in the server.xml. I can't find any kind of an analog for
>> this in glassfish, or any other place that seems obvious to specify
>> this. Thoughts anyone?
>>
>>
>> Thanks,
>> Peter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]