RE: WebDAV Servlet Q (beginner)

From: Alvaro Coronel <acoronel@xxx.com.uy>
Date: Thu Apr 04 2002 - 04:33:53 PST

Thanks Scott. I tried it, but unfortunately I got mixed results.

I'll send all the data I can because it might clarify things a bit more.

This is what the configuration file reads:

<web-app id='/cm/' app-dir='d:\projects\cm'>

<character-encoding>ISO-8859-1</character-encoding>

<cache-mapping url-pattern='/icons/*/*.gif' expires='24h'/>
<cache-mapping url-pattern='/icons/*/*.jpg' expires='24h'/>

        <classpath id='WEB-INF/classes' />
        <classpath id='d:\projects' />

<servlet servlet-name='action'
servlet-class='uy.com.swordfish.util.struts.FrontController' >
        <init-param config=/WEB-INF/struts-config.xml />
        <init-param validate=true />
</servlet>

<servlet-mapping url-pattern='/webdav/*'
                    servlet-name='com.caucho.http.webdav.WebDavServlet'>
  <init-param enable='write'/>
  <init-param secure='false'/>
  <init-param role='*'/>
</servlet-mapping>

<!--
<security-constraint url-pattern='/webdav/*' role-name='ADMIN'/>
-->

</web-app>

I "mounted" the webdav servlet as a folder successfully, and transferred
some USASCII files back and forth (using d&d) without problems.

I then proceeded to create a folder named Á (for Álvaro) which (confusingly)
was created but reported an error from Explorer.
The same situation happens everytime I double-click the folder to CD to it.
Resin's report is this:

[2002-04-04 09:40:24] [null, 2] PROPFIND /cm/webdav/%C1 HTTP/1.1
[2002-04-04 09:40:24] [null, 2] Accept-Language: en-gb, en-us;q=0.5
[2002-04-04 09:40:24] [null, 2] Content-Type: text/xml
[2002-04-04 09:40:24] [null, 2] Translate: f
[2002-04-04 09:40:24] [null, 2] Content-Length: 380
[2002-04-04 09:40:24] [null, 2] Depth: 1
[2002-04-04 09:40:24] [null, 2] User-Agent: Microsoft Data Access Internet
Publishing Provider DAV 1.1
[2002-04-04 09:40:24] [null, 2] Host: localhost
[2002-04-04 09:40:24] [null, 2] Connection: Keep-Alive
[2002-04-04 09:40:24] [null, 2] HTTP/1.1 500 Internal Server Error
[2002-04-04 09:40:24] [null, 2] Content-Type: text/html
[2002-04-04 09:40:24] [null, 2] Content-Length: 1181
[2002-04-04 09:40:24] [null, 2] Connection: close
[2002-04-04 09:40:24] [2] chunk: 1181
[2002-04-04 09:40:24] [2] close stream
[2002-04-04 09:40:24] [null, 2] end connection

Now as you by now realize I am not an expert in this, but isn't "%C1" a
urlEncoded() "Á" (&Atilde; I think).
I ask because I can see the URL in the web browser's "Address" field, and it
reads "http://localhost/cm/webdav/%C1"

Then when I try to transfer (d&d) a file named "Álvaro är", I got the same
old error:

[2002-04-04 09:43:37] [null, 0] HEAD /cm/webdav/%C1/%C1lvaro%20%E4r HTTP/1.1
[2002-04-04 09:43:37] [null, 0] Accept-Language: en-gb, en-us;q=0.5
[2002-04-04 09:43:37] [null, 0] Translate: f
[2002-04-04 09:43:37] [null, 0] Content-Length: 0
[2002-04-04 09:43:37] [null, 0] User-Agent: Microsoft Data Access Internet
Publishing Provider DAV 1.1
[2002-04-04 09:43:37] [null, 0] Host: localhost
[2002-04-04 09:43:37] [null, 0] Connection: Keep-Alive
[2002-04-04 09:43:37] [null, 0] HTTP/1.1 400 Bad Request The URL contains
escaped bytes unsupported by the utf-8 encoding.
[2002-04-04 09:43:37] [null, 0] Content-Type: text/html
[2002-04-04 09:43:37] [null, 0] Content-Length: 1215
[2002-04-04 09:43:37] [null, 0] Connection: close
[2002-04-04 09:43:37] [0] chunk: 1215
[2002-04-04 09:43:37] [0] close stream
[2002-04-04 09:43:37] [null, 0] end connection

Looking at the HEAD command, I see that the blank between "Álvaro" and "är"
has been changed into %20 - a URLEncoded blank AFAIK.

Well, that's all. I hope other people find this useful - I don't want to
bother anyone. And thanks very much for your answers.

Álvaro.

> -----Original Message-----
> From: Scott Ferguson [mailto:ferg@xxx.com]
> Sent: 03 April 2002 13:12
> To: resin-interest@xxx.com
> Subject: Re: WebDAV Servlet Q (beginner)
>
>
> Alvaro Coronel wrote:
> > Hello there.
> >
> > I have been trying the WebDAV servlet that comes with
> Resin, and found the
> > following problem:
> >
> > using Resin (2.0.4, 2.0.5 or 2.1) on Windows 2000 with Java
> 1.3 and Explorer
> > 5.5, I try to move a file called "Año" (year in spanish) to
> the web folder.
> > I get an HTTP 400 error with the message string "Bad Request The URL
> > contains escaped bytes unsupported by the utf-8 encoding."
> >
> > I have been looking at the source code. The exception seems
> to be thrown in
> > the
> > normalizeUriEscape() method of the
> com.caucho.server.http.Invocation class.
> >
> > The request to the servlet was "HEAD /cm/webdav/a%F1o2002 HTTP/1.1".
> >
> > I really don´t know how to follow from here. Is MS Explorer
> character
> > encoding broken? anyone can offer any pointers I can use to carry on
> > investigating?
>
> You need to change the <character-encoding> in the resin.conf
> (or web.xml).
>
> Resin uses UTF-8 encoding to interpret URLs by default. The
> example you
> give uses Latin-1 to encode the &ntilde; in the URL. The
> configuration
> would look like:
>
> <web-app id='/'>
> <character-encoding>ISO-8859-1</character-encoding>
>
> You could also use Latin-1 instead of ISO-8859-1; they're synonyms
> Unfortunately, HTTP assumes both browser and server have agreed
> beforehand on which character set to use, so Resin needs to guess.
>
> -- Scott
>
> >
> > TIA
> >
> > Alvaro Coronel
> >
>
>
>
Received on Thu 04 Apr 2002 04:33:53 -0800

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:17:00 PDT