Description
Currently, you can already set the property 'hst:scheme' on hosts. host, mount or sitemapitem. There are also getScheme() getters. However, the HST does not do anything with it.
I will introduce a new property
,
- hst:schemenotmatchresponsecode (long)
that can be used to define the servlet response code that the hst should invoke when the scheme from the servlet request does not match the configured scheme. The following hst:schemenotmatchresponsecode's are now supported:
HttpServletResponse.SC_OK: // just continue;
HttpServletResponse.SC_MOVED_PERMANENTLY :
res.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
// create fully qualified redirect to scheme from sitemap item
res.setHeader("Location", getFullyQualifiedURLforScheme(hstSiteMapItem.getScheme(), resolvedSiteMapItem.getResolvedMount().getMount(), req));
HttpServletResponse.SC_MOVED_TEMPORARILY:
// create fully qualified redirect to scheme from sitemap item
res.sendRedirect(getFullyQualifiedURLforScheme(hstSiteMapItem.getScheme(), resolvedSiteMapItem.getResolvedMount().getMount(), req));
HttpServletResponse.SC_NOT_FOUND:
sendError(req, res, HttpServletResponse.SC_NOT_FOUND);
HttpServletResponse.SC_FORBIDDEN:
sendError(req, res, HttpServletResponse.SC_FORBIDDEN);
Attachments
Issue Links
- relates to
-
HSTTWO-2491 Scheme is not propagated correctly when hst:scheme is defined but empty. In that case parent value should be inherited
- Closed