Skip to content

Instantly share code, notes, and snippets.

@greenlaw110
Created March 7, 2014 02:35
Show Gist options
  • Save greenlaw110/9404019 to your computer and use it in GitHub Desktop.
Save greenlaw110/9404019 to your computer and use it in GitHub Desktop.
import com.pixolut.mrb.mas.tool.*;
import com.pixolut.mrb.mas.models.*;
import com.pixolut.mrb.mas.controllers.*;
import java.util.*;
import org.rythmengine.template.TemplateBase;
import java.io.*;
public class errors_prod_error_html__R_T_C__ extends org.rythmengine.template.TagBase {
@Override public java.lang.String __getName() {
return "errors.prod.error";
}
@Override protected void __setup() {
if (__isDefVal(statusCode)) {statusCode = __get("statusCode",Integer.class) ;}
if (__isDefVal(message)) {message = __get("message",String.class) ;}
if (__isDefVal(attachment)) {attachment = __get("attachment",Object.class) ;}
if (__isDefVal(response)) {response = __get("response",javax.servlet.http.HttpServletResponse.class) ;}
if (__isDefVal(csrf)) {csrf = __get("csrf",org.rythmengine.spring.web.Csrf.class) ;}
if (__isDefVal(flash)) {flash = __get("flash",org.rythmengine.spring.web.Flash.class) ;}
if (__isDefVal(userAgent)) {userAgent = __get("userAgent",org.osgl.web.util.UserAgent.class) ;}
if (__isDefVal(session)) {session = __get("session",org.rythmengine.spring.web.Session.class) ;}
if (__isDefVal(request)) {request = __get("request",javax.servlet.http.HttpServletRequest.class) ;}
if (__isDefVal(httpSession)) {httpSession = __get("httpSession",javax.servlet.http.HttpSession.class) ;}
if (__isDefVal(__request)) {__request = __get("__request",javax.servlet.http.HttpServletRequest.class) ;}
}
protected int statusCode=0; //line: 1
protected String message=""; //line: 1
protected Object attachment=null; //line: 1
protected javax.servlet.http.HttpServletResponse response=null;
protected org.rythmengine.spring.web.Csrf csrf=null;
protected org.rythmengine.spring.web.Flash flash=null;
protected org.osgl.web.util.UserAgent userAgent=null;
protected org.rythmengine.spring.web.Session session=null;
protected javax.servlet.http.HttpServletRequest request=null;
protected javax.servlet.http.HttpSession httpSession=null;
protected javax.servlet.http.HttpServletRequest __request=null;
protected java.lang.String __renderArgName(int __pos) {
int __p = 0;
if (__p++ == __pos) return "statusCode";
else if (__p++ == __pos) return "message";
else if (__p++ == __pos) return "attachment";
else if (__p++ == __pos) return "response";
else if (__p++ == __pos) return "csrf";
else if (__p++ == __pos) return "flash";
else if (__p++ == __pos) return "userAgent";
else if (__p++ == __pos) return "session";
else if (__p++ == __pos) return "request";
else if (__p++ == __pos) return "httpSession";
else if (__p++ == __pos) return "__request";
throw new ArrayIndexOutOfBoundsException();
}
protected java.util.Map<java.lang.String, java.lang.Class> __renderArgTypeMap() {
java.util.Map<java.lang.String, java.lang.Class> __m = new java.util.HashMap<String, Class>();
__m.put("statusCode", int.class);
__m.put("message", String.class);
__m.put("attachment", Object.class);
__m.put("response", javax.servlet.http.HttpServletResponse.class);
__m.put("csrf", org.rythmengine.spring.web.Csrf.class);
__m.put("flash", org.rythmengine.spring.web.Flash.class);
__m.put("userAgent", org.osgl.web.util.UserAgent.class);
__m.put("session", org.rythmengine.spring.web.Session.class);
__m.put("request", javax.servlet.http.HttpServletRequest.class);
__m.put("httpSession", javax.servlet.http.HttpSession.class);
__m.put("__request", javax.servlet.http.HttpServletRequest.class);
return __m;
}
@SuppressWarnings("unchecked")
public TemplateBase __setRenderArgs(java.util.Map<java.lang.String, java.lang.Object> __args) {
if (null == __args) throw new NullPointerException();
if (__args.isEmpty()) return this;
super.__setRenderArgs(__args);
if (__args.containsKey("statusCode")) this.statusCode = __get(__args,"statusCode",Integer.class);
if (__args.containsKey("message")) this.message = __get(__args,"message",String.class);
if (__args.containsKey("attachment")) this.attachment = __get(__args,"attachment",Object.class);
if (__args.containsKey("response")) this.response = __get(__args,"response",javax.servlet.http.HttpServletResponse.class);
if (__args.containsKey("csrf")) this.csrf = __get(__args,"csrf",org.rythmengine.spring.web.Csrf.class);
if (__args.containsKey("flash")) this.flash = __get(__args,"flash",org.rythmengine.spring.web.Flash.class);
if (__args.containsKey("userAgent")) this.userAgent = __get(__args,"userAgent",org.osgl.web.util.UserAgent.class);
if (__args.containsKey("session")) this.session = __get(__args,"session",org.rythmengine.spring.web.Session.class);
if (__args.containsKey("request")) this.request = __get(__args,"request",javax.servlet.http.HttpServletRequest.class);
if (__args.containsKey("httpSession")) this.httpSession = __get(__args,"httpSession",javax.servlet.http.HttpSession.class);
if (__args.containsKey("__request")) this.__request = __get(__args,"__request",javax.servlet.http.HttpServletRequest.class);
return this;
}
@SuppressWarnings("unchecked") public TemplateBase __setRenderArgs(java.lang.Object... __args) {
int __p = 0, __l = __args.length;
if (__p < __l) {
Object v = __args[__p++];
statusCode = __safeCast(v, Integer.class);
__renderArgs.put("statusCode",statusCode);
}
if (__p < __l) {
Object v = __args[__p++];
message = __safeCast(v, String.class);
__renderArgs.put("message",message);
}
if (__p < __l) {
Object v = __args[__p++];
attachment = __safeCast(v, Object.class);
__renderArgs.put("attachment",attachment);
}
return this;
}
protected java.lang.Class[] __renderArgTypeArray() {
return new java.lang.Class[]{int.class, String.class, Object.class, };
}
@SuppressWarnings("unchecked") @Override public TemplateBase __setRenderArg(java.lang.String __name, java.lang.Object __arg) {
if ("statusCode".equals(__name)) this.statusCode = __safeCast(__arg, Integer.class);
else if ("message".equals(__name)) this.message = __safeCast(__arg, String.class);
else if ("attachment".equals(__name)) this.attachment = __safeCast(__arg, Object.class);
else if ("response".equals(__name)) this.response = __safeCast(__arg, javax.servlet.http.HttpServletResponse.class);
else if ("csrf".equals(__name)) this.csrf = __safeCast(__arg, org.rythmengine.spring.web.Csrf.class);
else if ("flash".equals(__name)) this.flash = __safeCast(__arg, org.rythmengine.spring.web.Flash.class);
else if ("userAgent".equals(__name)) this.userAgent = __safeCast(__arg, org.osgl.web.util.UserAgent.class);
else if ("session".equals(__name)) this.session = __safeCast(__arg, org.rythmengine.spring.web.Session.class);
else if ("request".equals(__name)) this.request = __safeCast(__arg, javax.servlet.http.HttpServletRequest.class);
else if ("httpSession".equals(__name)) this.httpSession = __safeCast(__arg, javax.servlet.http.HttpSession.class);
else if ("__request".equals(__name)) this.__request = __safeCast(__arg, javax.servlet.http.HttpServletRequest.class);
super.__setRenderArg(__name, __arg);
return this;
}
@SuppressWarnings("unchecked") public TemplateBase __setRenderArg(int __pos, java.lang.Object __arg) {
int __p = 0;
if (__p++ == __pos) {
Object v = __arg;
statusCode = __safeCast(v, Integer.class);
__renderArgs.put("statusCode", statusCode);
}
else if (__p++ == __pos) {
Object v = __arg;
message = __safeCast(v, String.class);
__renderArgs.put("message", message);
}
else if (__p++ == __pos) {
Object v = __arg;
attachment = __safeCast(v, Object.class);
__renderArgs.put("attachment", attachment);
}
else if (__p++ == __pos) {
Object v = __arg;
response = __safeCast(v, javax.servlet.http.HttpServletResponse.class);
__renderArgs.put("response", response);
}
else if (__p++ == __pos) {
Object v = __arg;
csrf = __safeCast(v, org.rythmengine.spring.web.Csrf.class);
__renderArgs.put("csrf", csrf);
}
else if (__p++ == __pos) {
Object v = __arg;
flash = __safeCast(v, org.rythmengine.spring.web.Flash.class);
__renderArgs.put("flash", flash);
}
else if (__p++ == __pos) {
Object v = __arg;
userAgent = __safeCast(v, org.osgl.web.util.UserAgent.class);
__renderArgs.put("userAgent", userAgent);
}
else if (__p++ == __pos) {
Object v = __arg;
session = __safeCast(v, org.rythmengine.spring.web.Session.class);
__renderArgs.put("session", session);
}
else if (__p++ == __pos) {
Object v = __arg;
request = __safeCast(v, javax.servlet.http.HttpServletRequest.class);
__renderArgs.put("request", request);
}
else if (__p++ == __pos) {
Object v = __arg;
httpSession = __safeCast(v, javax.servlet.http.HttpSession.class);
__renderArgs.put("httpSession", httpSession);
}
else if (__p++ == __pos) {
Object v = __arg;
__request = __safeCast(v, javax.servlet.http.HttpServletRequest.class);
__renderArgs.put("__request", __request);
}
if(0 == __pos) __setRenderArg("arg", __arg);
return this;
}
@Override public org.rythmengine.utils.TextBuilder build(){
buffer().ensureCapacity(612);
//line: 3
org.rythmengine.template.ITag.__ParameterList __pl = new org.rythmengine.template.ITag.__ParameterList(); //line: 4
__pl.add("statusCode", statusCode); //line: 5
__pl.add("message", message); //line: 6
__pl.add("attachment", attachment); //line: 7
try { //line: 8
__invokeTag(0, "errors.prod." + statusCode, __pl); //line: 9
return this; //line: 10
} catch (NullPointerException e) { //line: 11
// ignore //line: 12
} //line: 13
; //line: 13
p("\n<!DOCTYPE html>\n<html>\n<head>\n<title>"); //line: 17
try{pe(message);} catch (RuntimeException e) {__handleTemplateExecutionException(e);} //line: 17
p("</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n</head>\n<body>\n<p><b>"); //line: 21
try{pe(statusCode);} catch (RuntimeException e) {__handleTemplateExecutionException(e);} //line: 21
p("</b> - "); //line: 21
try{pe(message);} catch (RuntimeException e) {__handleTemplateExecutionException(e);} //line: 21
p("</p>\n</body>\n</html>"); //line: 23
return this;
}
protected org.rythmengine.utils.RawData url(String path) {
if (path == null) path = "/";
if (!path.startsWith("//") && !path.startsWith("http")) {
path = __request.getContextPath() + (path.startsWith("/") ? "" : "/") + path;
}
return new org.rythmengine.utils.RawData(path);
}
protected org.rythmengine.utils.RawData fullUrl(String path) {
if (path == null) path = "/";
if (path.startsWith("//") || path.startsWith("http")) {
return new org.rythmengine.utils.RawData(path);
}
if (!path.startsWith("/")) {path = path + "/";}
String ctx = __request.getContextPath(); StringBuilder sb = new StringBuilder();
sb.append(__request.getScheme());
sb.append("://");
sb.append(__request.getServerName()).append(":");
sb.append(__request.getServerPort());
sb.append(ctx).append(path);
return new org.rythmengine.utils.RawData(sb);}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment