Hi, All!

GWT 1.5.2/Windows.

We are trying to implement servlets (e.g.: public class ExcelServlet
extends HttpServlet) to serve generated Excel files for GWT
applications.

We pass certain parameters for servlet via URI encoding, e.g.

    link.append("<a target=\"_blank\" href=\"./excelServlet?");
 
link.append("session=").append(URL.encodeComponent(ServerCall.getSessionGuid()));
 
link.append("&guid=").append(URL.encodeComponent(componentMeta.guid));
 
link.append("&view=").append(URL.encodeComponent(viewPanel.viewMeta.caption)); 
//
good stuff here
    link.append("&archive=").append(isArchive);
 
link.append("&params=").append(URL.encodeComponent(createParametersString().toString()));
    link.append("\">");
....
    link.append("</a>");
...
    setHTML...
...


The problem appears with non-Latin1 (e.g. Cyrillic) code points
encoded in URI components, e.g.:

  public void doGet(
      HttpServletRequest request,
      HttpServletResponse response
  )
      throws ServletException, IOException
  {
    //request.setCharacterEncoding("UTF8");

    String view = request.getParameter("view"); // Garbage here


When Servlet receives them in Hosted mode they become garbage, because
Servlet interpreted them as ISO Latin1, instead of UTF8. Using
setCharacterEncoding doesn't help either, even with filters.

In regular Tomcat I can set URIEncoding attribute for connector and
everything works correctly:
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>

What is the proper way to set URIEncoding connector attribute for
hosted mode Tomcat?
I couldn't figure out where should I put server.xml and how to set it
up.

The following workarounds would work:
1) do - new String(view.getBytes(...)...) to repair scrambled string
2) parse getQueryString manually (long live CGI!)

Using Mbeans to manipulate connector may also work, but I didn't try.

But I'd prefer not to use dirty hacks to work around the problem.
Shouldn't basic Servlet functionality also work in hosted mode?

Nikolay Samofatov

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to