Hello Leo,

You can add your custom header in the response via the
HttpServletResponse.addHeader() [1] method.

Hope it helps,

Luis

[1]
https://tomcat.apache.org/tomcat-8.5-doc/servletapi/javax/servlet/http/HttpServletResponse.html#addHeader(java.lang.String,%20java.lang.String)






El lun, 17 may 2021 a las 3:54, leo (<tom...@halloleo.hailmail.net>)
escribió:

> Rony,
>
> Thanks for chiming! :-)
>
> >> […] In the JSP pages I retrieve the session
> >> object *through Java* like this
> >>
> >>     <%
> >>         HttpSession session = request.getSession();
> >>         ...
> >>         user = (String)session.getAttribute("user");
> >>         ...
> >>     %>
> >>
> >> Then later on these pages *in the JavaScript* part I have:
> >>
> >>     <script type="text/javascript">
> >>         var user = "<%=user%>"
> >>         ...
> >>     </script>
> >>
> >> Question: Can I get the content of the session object in pure
> >> JavaScript? […]
> >
> > what taglib are you using?
>
> Sorry to appear ignorant, but I don’t know. I just use the <% …. %>
> and <%= … %> constructs in my JSP pages.
>
> I don’t maintain the server (it is Tomcat 8.5), but I could request
> small changes  (as long as they don’t break existing stuff!). Any way
> to find out what taglib the server provides?
>
> > or is your example purely hypothetical?
>
> No, no not at all. This is the code I use.
>
> Thanks and regards,
> Leo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett

Reply via email to