пн, 12 апр. 2021 г. в 18:05, Rob Sargent <[email protected]>:
> > [...]
>
> The datum of concern is handled via the session.
>
>   //Hold the offset of the first explicit marker in the chased
>   //segment.  That marker at most 16th locus up-stream of
>   //segment. Less at pter.  There are more markers found within the
>   //spanning cliques but these are not at predictable positions
>   private void setRebase(HttpServletRequest req, Integer value) {
>     req.getSession().setAttribute("rebase", value);
>   }
>
>   private Integer getRebase(HttpServletRequest req) {
>     return (Integer)(req.getSession().getAttribute("rebase"));
>   }
>
> I confess, in preparing this response I noticed that I start sending the 
> first lines of the streamed data then set the header as follows:
>       response.setHeader("rebaseSegment", "" + getRebase(req));
> then the remainder of the stream.  I’ll correct that and see if that plays 
> into the behaviour at all.
>
> The isCommitted() will come in handy too.  Thanks for that.

Ack.

BTW, usage of getSession() has similar limitation as
setHeader/addHeader versus isCommitted:
a session cannot be created when it is tracked via Cookies and
response headers have already been sent.

There is a difference in API though, as getSession() throws an
explicit IllegalStateException.

https://javaee.github.io/javaee-spec/javadocs/javax/servlet/http/HttpServletRequest.html#getSession-boolean-

Best regards,
Konstantin Kolinko

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

Reply via email to