</subsection>
<subsection name="Web applications">
<changelog>
+ <fix>
+ <bug>21157</bug>: Ensure cookies are written before the response is
+ commited in the Cookie example. Patch provided by Stefan Radzom. (markt)
+ </fix>
<add>
<bug>50294</bug>: Add more information to documentation regarding format
of configuration files. Patch provided by Luke Meyer. (markt)
HttpServletResponse response)
throws IOException, ServletException
{
+
+ String cookieName = request.getParameter("cookiename");
+ String cookieValue = request.getParameter("cookievalue");
+ Cookie aCookie = null;
+ if (cookieName != null && cookieValue != null) {
+ aCookie = new Cookie(cookieName, cookieValue);
+ response.addCookie(aCookie);
+ }
+
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println(RB.getString("cookies.no-cookies"));
}
- String cookieName = request.getParameter("cookiename");
- String cookieValue = request.getParameter("cookievalue");
- if (cookieName != null && cookieValue != null) {
- Cookie cookie = new Cookie(cookieName, cookieValue);
- response.addCookie(cookie);
+ if (aCookie != null) {
out.println("<P>");
out.println(RB.getString("cookies.set") + "<br>");
out.print(RB.getString("cookies.name") + " "