Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom header not inserted in request in servlet
    primarykey
    data
    text
    <p>There's a thrird party app that needs to get information via custom http headers, so I wrote a simple test app that creates this headers and then redirects to a page that lists all headers.</p> <p>The header-generating servlet snippet is:</p> <pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/plain"); response.setHeader("cust-header", "cust-val"); response.sendRedirect("header.jsp"); } </code></pre> <p>On the other hand, the relevant code from header.jsp is:</p> <pre><code>&lt;% Enumeration enumeration = request.getHeaderNames(); while (enumeration.hasMoreElements()) { String string = (String)enumeration.nextElement(); out.println("&lt;font size = 6&gt;" +string +": " + request.getHeader(string)+ "&lt;/font&gt;&lt;br&gt;"); } %&gt; </code></pre> <p>That displays the following headers:</p> <pre><code>Host: localhost:9082 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; es-ES; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://localhost:9082/HdrTest/login.jsp Cookie: JSESSIONID=0000tubMmZOXDyuM4X9RmaYYTg4:-1 </code></pre> <p>As if the custom header was never inserted. How can I fix it ?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload