/** * <p> * Adds a variable to the current set of context variables. * </p> * * @param name the name of the variable. * @param value the value of the variable. */ public final void setVariable(final String name, final Object value) { Validate.notNull(name, "Variable name cannot be null"); this.variables.put(name, value); }
public ThymeleafCall template(final String name) { final IContext ctx = makeContext(); // Expose the service configuration ctx.getVariables().put("config", configuration); ctx.getVariables().putAll(data); return new ThymeleafCall(engine, ctx, name, calls, failures); }
public ThymeleafCall template(final String name) { final IContext ctx = makeContext(); // Expose the service configuration ctx.getVariables().put("config", configuration); ctx.getVariables().putAll(data); return new ThymeleafCall(engine, ctx, name, calls, failures); }
/** * Sets a variable which is then exposed to the view layer * * @param name * @param value * * @return */ public ThymeleafCall set(String name, Object value) { context.getVariables().put(name, value); return this; }
/** * Sets a variable which is then exposed to the view layer * * @param name * @param value * * @return */ public ThymeleafCall set(String name, Object value) { context.getVariables().put(name, value); return this; }
WebVariablesMap(final HttpServletRequest request, final ServletContext servletContext, final Map<? extends String, ?> m) { super((m == null? 4 : m.size() + 4), 1.0f); this.request = request; this.servletContext = servletContext; this.requestParamsVariablesMap = new WebRequestParamsVariablesMap(this.request); this.sessionVariablesMap = new WebSessionVariablesMap(this.request); this.servletContextVariablesMap = new WebServletContextVariablesMap(this.servletContext); super.put(APPLICATION_VARIABLE_NAME, this.servletContextVariablesMap); super.put(PARAM_VARIABLE_NAME, this.requestParamsVariablesMap); super.put(SESSION_VARIABLE_NAME, this.sessionVariablesMap); if (m != null) { // This must be done at the end because it relies on the request having been already set. putAll(m); } }