com.jfinal.render.Render Java Examples

The following examples show how to use com.jfinal.render.Render. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JPressRenderFactory.java    From jpress with GNU Lesser General Public License v3.0 6 votes vote down vote up
private Render getTemplateRender(int errorCode) {
    Template template = TemplateManager.me().getCurrentTemplate();
    if (template == null) {
        return super.getErrorRender(errorCode);
    }

    StringBuilder errorViewbuilder = new StringBuilder("error_")
            .append(errorCode)
            .append(".html");


    String view = template.matchView(errorViewbuilder.toString(),
            RequestUtil.isMobileBrowser(JPressHandler.getCurrentRequest()));
    if (view == null) {
        return super.getErrorRender(errorCode);
    }


    return new TemplateRender(template.buildRelativePath(view), errorCode);
}
 
Example #2
Source File: JPressRenderFactory.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Render getErrorRender(int errorCode) {
    if (JPressHandler.getCurrentTarget().startsWith("/admin/")) {
        if (errorCode == 404) {
            return getErrorRender(errorCode, "/WEB-INF/views/admin/error/404.html");
        } else {
            return getErrorRender(errorCode, "/WEB-INF/views/admin/error/500.html");
        }
    }
    return getTemplateRender(errorCode);
}
 
Example #3
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getJsonRender(String jsonText) {
    return new JbootJsonRender(jsonText);
}
 
Example #4
Source File: JFinal3BeetlRenderFactory.java    From beetl2.0 with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public Render getRender(String view) {
	return new JFinal3BeetlRender(groupTemplate,view);
}
 
Example #5
Source File: JetTemplateRenderFactory.java    From jetbrick-template-1x with Apache License 2.0 4 votes vote down vote up
@Override
public Render getRender(String view) {
    return new JetTemplateRender(view);
}
 
Example #6
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
public Render getReturnValueRender(Action action, Object returnValue) {
    return new JbootReturnValueRender(action, returnValue);
}
 
Example #7
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getRedirect301Render(String url, boolean withQueryString) {
    return new JbootRedirect301Render(url, withQueryString);
}
 
Example #8
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getRedirect301Render(String url) {
    return new JbootRedirect301Render(url);
}
 
Example #9
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getRedirectRender(String url, boolean withQueryString) {
    return new JbootRedirectRender(url, withQueryString);
}
 
Example #10
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getRedirectRender(String url) {
    return new JbootRedirectRender(url);
}
 
Example #11
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getXmlRender(String view) {
    return new JbootXmlRender(view);
}
 
Example #12
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getTemplateRender(String view) {
    return new JbootTemplateRender(view);
}
 
Example #13
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getJsonRender(Object object) {
    return new JbootJsonRender(object);
}
 
Example #14
Source File: AppRenderFactory.java    From jboot-admin with Apache License 2.0 4 votes vote down vote up
@Override
public Render getRender(String view) {
    return super.getRender(view);
}
 
Example #15
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getJsonRender(String[] attrs) {
    return new JbootJsonRender(attrs);
}
 
Example #16
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getJsonRender(String key, Object value) {
    return new JbootJsonRender(key, value);
}
 
Example #17
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getJsonRender() {
    return new JbootJsonRender();
}
 
Example #18
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getErrorRender(int errorCode, String view) {
    return new JbootErrorRender(errorCode, view);
}
 
Example #19
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getErrorRender(int errorCode) {
    return new JbootErrorRender(errorCode, constants.getErrorView(errorCode));
}
 
Example #20
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getJavascriptRender(String jsText) {
    return new JbootJavascriptRender(jsText);
}
 
Example #21
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getTextRender(String text, ContentType contentType) {
    return new JbootTextRender(text, contentType);
}
 
Example #22
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getTextRender(String text, String contentType) {
    return new JbootTextRender(text, contentType);
}
 
Example #23
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getTextRender(String text) {
    return new JbootTextRender(text);
}
 
Example #24
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getHtmlRender(String htmlText) {
    return new JbootHtmlRender(htmlText);
}
 
Example #25
Source File: JbootRenderFactory.java    From jboot with Apache License 2.0 4 votes vote down vote up
@Override
public Render getRender(String view) {
    return new JbootRender(view);
}
 
Example #26
Source File: AppRenderFactory.java    From jboot-admin with Apache License 2.0 4 votes vote down vote up
@Override
public Render getErrorRender(int errorCode) {
    return new ErrorRender(errorCode, constants.getErrorView(errorCode));
}