use of uk.nhs.digital.ps.beans.Dataset in project hippo by NHS-digital-website.
the class DatasetComponent method doBeforeRender.
@Override
public void doBeforeRender(final HstRequest request, final HstResponse response) throws HstComponentException {
super.doBeforeRender(request, response);
final HstRequestContext ctx = request.getRequestContext();
Dataset dataset = (Dataset) ctx.getContentBean();
if (!dataset.isPubliclyAccessible()) {
try {
response.forward("/error/404");
} catch (IOException ioException) {
throw new HstComponentException("forward failed", ioException);
}
return;
}
request.setAttribute("dataset", dataset);
}
Aggregations