Package org.apache.struts2.util

Examples of org.apache.struts2.util.AttributeMap


        } else {
            // let's make sure that the current page context is in the action context
            Map<String, Object> context = stack.getContext();
            context.put(ServletActionContext.PAGE_CONTEXT, pageContext);

            AttributeMap attrMap = new AttributeMap(context);
            context.put("attr", attrMap);
        }

        return stack;
    }
View Full Code Here


        extraContext.put(MODE_NAMESPACE_MAP, modeMap);
        extraContext.put(PortletConstants.DEFAULT_ACTION_MAP, actionMap);

        extraContext.put(PortletConstants.PHASE, phase);

        AttributeMap attrMap = new AttributeMap(extraContext);
        extraContext.put("attr", attrMap);

        return extraContext;
    }
View Full Code Here

        extraContext.put("request", requestMap);
        extraContext.put("session", sessionMap);
        extraContext.put("application", applicationMap);
        extraContext.put("parameters", parameterMap);

        AttributeMap attrMap = new AttributeMap(extraContext);
        extraContext.put("attr", attrMap);

        return extraContext;
    }
View Full Code Here

        extraContext.put("request", requestMap);
        extraContext.put("session", sessionMap);
        extraContext.put("application", applicationMap);
        extraContext.put("parameters", parameterMap);

        AttributeMap attrMap = new AttributeMap(extraContext);
        extraContext.put("attr", attrMap);

        return extraContext;
    }
View Full Code Here

   * @param t
   *            the exception
   * @return the exception as a string.
   */
  protected String toString(Throwable t) {
    FastByteArrayOutputStream bout = new FastByteArrayOutputStream();
    PrintWriter wrt = new PrintWriter(bout);
    t.printStackTrace(wrt);
    wrt.close();
    return bout.toString();
  }
View Full Code Here

    }};

    protected Container container;

    public DefaultActionMapper() {
        prefixTrie = new PrefixTrie() {
            {
                put(METHOD_PREFIX, new ParameterAction() {
                    public void execute(String key, ActionMapping mapping) {
                        if (allowDynamicMethodCalls) {
                            mapping.setMethod(key.substring(
View Full Code Here

    }};

    protected Container container;

    public DefaultActionMapper() {
        prefixTrie = new PrefixTrie() {
            {
                put(METHOD_PREFIX, new ParameterAction() {
                    public void execute(String key, ActionMapping mapping) {
                        if (allowDynamicMethodCalls) {
                            mapping.setMethod(key.substring(
View Full Code Here

                    }
                    // no wait result? hmm -- let's try to do dynamically put it in for you!

                    //we used to add a fake "wait" result here, since the configuration is unmodifiable, that is no longer
                    //an option, see WW-3068
                    FreemarkerResult waitResult = new FreemarkerResult();
                    container.inject(waitResult);
                    waitResult.setLocation("/org/apache/struts2/interceptor/wait.ftl");
                    waitResult.execute(actionInvocation);

                    return Action.NONE;
                }

                return WAIT;
View Full Code Here

  freemarker.template.Configuration cfg;

  protected void buildCfg() {
    cfg = new freemarker.template.Configuration();
    cfg.setTemplateLoader(new StrutsClassTemplateLoader());
    cfg.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER);
    cfg.setObjectWrapper(new BeangleObjectWrapper(true));
    cfg.setDefaultEncoding("utf-8");
  }
View Full Code Here

  public void testText() throws Exception {
    Map<String, Object> datas = CollectUtils.newHashMap();
    datas.put("b", new BeangleTagLibrary(ActionContext.getContext().getValueStack(),
        new MockHttpServletRequest(), new MockHttpServletResponse()));
    datas.put("s", new StrutsModels(ActionContext.getContext().getValueStack(),
        new MockHttpServletRequest(), new MockHttpServletResponse()));
    datas.put("watch", new StopWatch());
    StringWriter writer = new StringWriter();
    Template template = cfg.getTemplate("comp.ftl");
    // template.process(datas, writer);
View Full Code Here

TOP

Related Classes of org.apache.struts2.util.AttributeMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.