这是我的代码(在 Google App Engine 上看到)
public void doGet(HttpServletRequest request, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
response.setHeader("testHeader1", "hi"); // Works fine
response.setHeader("testHeader2", "שלום"); // Header not visible on Chrome client
response.sendRedirect("/myUrl#שלום"); // Redirect does not work on browser (302 sent but Location header is absent)
谢谢!