我正在使用grails jade插件,我想使用我的GSP标签(例如g:layoutTitle),但我无法解决这个问题。其他人都知道吗?
答案 0 :(得分:0)
默认的GSP代码不可用。
正如您在 GrailsJadeView 类中所看到的,唯一可访问的属性是:
请求,会话,应用程序,参数和闪存
package com.netflix.grails.plugins.jade;
import de.neuland.jade4j.spring.view.JadeView;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest;
import org.codehaus.groovy.grails.web.util.WebUtils;
class GrailsJadeView extends JadeView {
@Override
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
model.put("request", WebObjectConverter.toMap(request));
model.put("session", WebObjectConverter.toMap(request.getSession()));
model.put("application", WebObjectConverter.toMap(request.getServletContext()));
GrailsWebRequest webRequest = WebUtils.retrieveGrailsWebRequest();
model.put("params", webRequest.getParams());
model.put("flash", webRequest.getAttributes().getFlashScope(request));
super.renderMergedOutputModel(model, request, response);
}
}