Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
set headers, cookie
notApplicable100
Dear forum
From within a component, preferably using Java, we need to customize the cookie and possibly other headers as well of the page.
How is this best accomplished in LiveSite 3.0.2?
Any way to access tomcat's servlet headers from the component?
Kind regards,
nA100
Find more posts tagged with
Comments
tec_iwov
off of RequestContext you have access to httpRequest and httpResponse
notApplicable100
..and just how does one do that?
A sample codesnippet for an instance of RequestContext actually gets the httpResponse object would be highly appreciated.
drew1
You would create an external (see developer docs for this), which would have code something like:
public class CookieExternal
{
public Document addCookie(RequestContext context)
{
context.getResponse().addCookie(new Cookie(...));
}
}
similarly context.getRequest() to get the HttpServletRequest object.