Very interesting - a concrete example is always more interesting
to investigate than an abstract bug!

So I gave your code a try and it worked fine on my system!
I can't imagine what might be making it run for me but not run for you..

Just a by-the-way: I think you should also be setting
the charset attribute of the content type for safety,
but I have to admit I don't either, and accents have
always worked fine for me.

How I run it (ie how it works fine):
* tomcat 3.2.1 on HPUX
* Microsoft IE4 as the browser
* I set up a specific servlet-mapping to run the HelloWorldExample,
  rather than running it through the invoker servlet. (I had deliberately
  turned off the invoker servlet a long time ago; funny enough, I
  can't seem to get it running again now...)


You might want to try using a url-encoded version of your url, ie
not
http://my_ip/servlet/HelloWorldExample?name=Andr�
but
http://my_ip/servlet/HelloWorldExample?name=Andr%E9

Actually, though, both of these work OK for me anyway.

I'll have a think about this tomorrow (home time now) -
good luck tracking this down...

Simon
> -----Original Message-----
> From: Andr� Alves [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, January 04, 2001 9:06 PM
> To:   [EMAIL PROTECTED]
> Subject:      a simple test to charset
> 
> I, made the following test:
> import java.io.*;
> import java.text.*;
> import java.util.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> 
> public class HelloWorldExample extends HttpServlet
> {
>   public void doGet(HttpServletRequest request, HttpServletResponse
> response) throws IOException, ServletException
>   {
>     String strName = request.getParameter("name"); 
>     response.setContentType("text/html");
>     PrintWriter out = response.getWriter();
> 
>     out.println("<html>");
>     out.println("<head>");
>     out.println("</head>");
>     out.println("<body bgcolor=\"white\">");
>     out.println("<body>");
>     out.println("start");
>     out.println("<br>");
>     out.println("Name = "+strName);
>     out.println("<br>");
>     out.println("end");
>     out.println("</body>");
>     out.println("</html>");
>   }
> }
> 
> And I invoke this servlet with the url:
> http://my_ip/servlet/HelloWorldExample?name=Andr�
> 
> The html responde is:
> 
> start
> Name: Andr
> end
> 
> Tomcat did not catch special caracter "�". 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - Share your holiday photos online!
> http://photos.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

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

Reply via email to