/** * Starts the context when entering the tag. * * @param context The page context to use. */ protected void startContext(PageContext context) { if (container != null) { attributeContext = container.startContext(pageContext); } }
@Override public AttributeContext startContext(Request request) { return container.startContext(request); } }
/** * Starts the context when entering the tag. * * @param context The page context to use. */ protected void startContext(PageContext context) { if (container != null) { attributeContext = container.startContext(pageContext); } }
value, name, role, ignore, defaultValue, defaultValueRole, defaultValueType, request); container.startContext(request); return attribute;
value, name, role, ignore, defaultValue, defaultValueRole, defaultValueType, request); container.startContext(request); return attribute;
/** * Starts the attribute context. Remember to call * {@link #endAttributeContext()} when finished! * * @return The started attribute context, ready to be customized. * @since 2.2.0 */ public AttributeContext startAttributeContext() { Request velocityRequest = createVelocityRequest( getServletContext(), null); TilesContainer container = TilesAccess .getCurrentContainer(velocityRequest); return container.startContext(velocityRequest); }
/** * * @param actionUrl url should be start with "/" * @param request HttpServletRequest * @param response HttpServletResponse * @throws Exception Exception */ public static void render(String actionUrl, HttpServletRequest request, HttpServletResponse response) throws Exception { TilesContainer container = TilesAccess.getContainer( request.getSession().getServletContext()); AttributeContext attributeContext = container.startContext(request, response); Attribute attr = new Attribute(actionUrl); attributeContext.putAttribute("body", attr); container.render("main.layout", request, response); container.endContext(request, response); }
private void renderTilesView(ExternalContext externalContext, Object[] requestObjects, TilesContainer container, UIViewRoot viewToRender, String viewId, String tilesId) { handleCharacterEncoding(viewId, externalContext, viewToRender); container.startContext(requestObjects); try { container.render(tilesId,requestObjects); } catch (TilesException e) { throw new FacesException(e); } finally { container.endContext(requestObjects); } handleCharacterEncodingPostDispatch(externalContext); }
@Override public void doExecute(String location, ActionInvocation invocation) throws Exception { ServletContext context = ServletActionContext.getServletContext(); HttpServletRequest request = ServletActionContext.getRequest(); HttpServletResponse response = ServletActionContext.getResponse(); ApplicationContext applicationContext = ServletUtil.getApplicationContext(context); ServletRequest servletRequest = new ServletRequest(applicationContext, request, response); TilesContainer container = initTilesContainer(applicationContext, servletRequest); container.startContext(servletRequest); container.render(location, servletRequest); }
/** * Executes the operation. * @param template The template to render. * @param templateType The type of the template attribute. * @param templateExpression The expression to evaluate to get the value of the template. * @param role A comma-separated list of roles. If present, the template * will be rendered only if the current user belongs to one of the roles. * @param preparer The preparer to use to invoke before the definition is * rendered. If specified, it overrides the preparer specified in the * definition itself. * @param flush If <code>true</code>, the response will be flushed after the insert. * @param request The request. * @param modelBody The body. * @throws IOException If something goes wrong. * @since 2.2.0 */ public void execute(@Parameter(required = true) String template, String templateType, String templateExpression, String role, String preparer, boolean flush, Request request, ModelBody modelBody) throws IOException { TilesContainer container = TilesAccess.getCurrentContainer(request); container.startContext(request); modelBody.evaluateWithoutWriting(); container = TilesAccess.getCurrentContainer(request); renderTemplate(container, template, templateType, templateExpression, role, preparer, flush, request); }
/** * Executes the operation. * @param definitionName The name of the definition to render. * @param template If specified, this template will be used instead of the * one used by the definition. * @param templateType The type of the template attribute. * @param templateExpression The expression to evaluate to get the value of the template. * @param role A comma-separated list of roles. If present, the definition * will be rendered only if the current user belongs to one of the roles. * @param preparer The preparer to use to invoke before the definition is * rendered. If specified, it overrides the preparer specified in the * definition itself. * @param flush If <code>true</code>, the response will be flushed after the insert. * @param request The request. * @param modelBody The body. * @throws IOException If something goes wrong. * @since 2.2.0 */ public void execute( @Parameter(name = "name", required = true) String definitionName, String template, String templateType, String templateExpression, String role, String preparer, boolean flush, Request request, ModelBody modelBody) throws IOException { TilesContainer container = TilesAccess.getCurrentContainer(request); container.startContext(request); modelBody.evaluateWithoutWriting(); container = TilesAccess.getCurrentContainer(request); renderDefinition(container, definitionName, template, templateType, templateExpression, role, preparer, flush, request); }