users@grizzly.java.net

Re: wierd case with ServletAdapter with "\"

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Tue, 28 Apr 2009 16:11:40 -0400

Salut,

{switch to users as this is always helpfull to know for grizzlyAdapter
developper}

Survivant 00 wrote:
> I try something wierd. I wanted to show a URL that represent a filename
> on disk. I'm on windows.
>
>
> my filename is :
> c:\music\10 Years - Beautiful.mp3
>
> I used URLEncoder.encode(audioFilename, "UTF-8")
>
> and received : c%3A%5Cmusic%5C10+Years+-+Beautiful.mp3
>
> I wanted to call this URL :
> http://localhost:8080/c%3A%5Cmusic%5C10+Years+-+Beautiful.mp3

root folder is something/ and music is under something, right?

>
> but the servlet is never called. if I use http://localhost:8080/c%3A
> it will works.
>
>
> I try with Firefox. When I enter the URL.. the result in the URL is
> changed to http://localhost:8080/c%3A\music\10+Years+-+Beautiful.mp3
>
> but in IE.. it stay
> http://localhost:8080/c%3A%5Cmusic%5C10+Years+-+Beautiful.mp3

what re you getting if you add the / between music and 10? Also why are
you URL encoding the link? Specially the c:\ is not needed IMO.

A+

-- Jeanfrancois

>
>
> I try with many combination for mapping.. but the result is always the same.
>
>
> ServletAdapter sa = new ServletAdapter();
>
> Servlet servlet =
> (Servlet)ClassLoaderUtil.load("helloworldServlet");
> sa.setContextPath("/");
> sa.setServletPath("");
> sa.setServletInstance(servlet);
>
> ws.addGrizzlyAdapter(sa, new String[]{"*"});
>
> the result expected is "hello world!"
>