在我看来,当请求不存在的Mura FW / 1插件动作时抛出404是有意义的。
例如,如果请求https://local.mysite.info/trainings/?calendaraction=main.thisActionIsBogus(指代放置在区域中的插件内容对象),我希望呈现网站404。我不知道a)这是否可行或b)如何实现它。
以下是插件Application.cfc
中的一些愚蠢实验:
public any function onMissingView(any rc) {
var $ = rc.$;
// yields redirect loop
// application.serviceFactory.getBean('contentServer').render404();
/* yields:
* variable [OUT] doesn't exist at lucee.runtime.type.scope.UndefinedImpl.get(UndefinedImpl.java:226):226 at
* includes.fw1_cfc$cf.udfCall5(/var/www/vmhost/apps/mysite/cfml/deployment_root/wwwroot/plugins/calendar/includes/fw1.cfc:825):82
* ... */
//$.event('content', $.getBean('content').loadBy(filename='404'));
// yields: component [calendar.Application] has no function with name [doAction]
//getPageContext().forward("https://local.mysite.info/404/"));
// works, sort of, but not well: gives a 302, then the plugin-specific
// 404 view kicks in and returns 404
//redirect(action="public:errors.404"); // , queryString="template=json"
// yields: component [calendar.Application] has no function with name [doAction]
//getPageContext().forward("https://local.mysite.info/404/"));
}