Package org.beangle.struts2.convention.route

Examples of org.beangle.struts2.convention.route.Action


@Test
public class SmartActionConfigBuilderTest {

  public void test21() {
    ActionBuilder actionNameBuilder = new DefaultActionBuilder();
    ProfileService profileService = new ProfileServiceImpl();
    actionNameBuilder.setProfileService(profileService);

    ObjectFactory of = new ObjectFactory();
    final DummyContainer mockContainer = new DummyContainer();
    Configuration configuration = new DefaultConfiguration() {
View Full Code Here


    library.authorityManager = authorityManager;
    return library;
  }

  public TagModel getGuard() {
    TagModel model = models.get(Guard.class);
    if (null == model) {
      model = new TagModel(stack) {
        protected Component getBean() {
          return new Guard(stack, authorityManager);
        }
      };
      models.put(Guard.class, model);
View Full Code Here

    }
    return model;
  }

  public TagModel getAvatar() {
    TagModel model = models.get(AvatarImage.class);
    if (null == model) {
      model = new TagModel(stack) {
        protected Component getBean() {
          return new AvatarImage(stack, authorityManager);
        }
      };
      models.put(AvatarImage.class, model);
View Full Code Here

    }
    return model;
  }

  public TagModel getUserinfo() {
    TagModel model = models.get(Userinfo.class);
    if (null == model) {
      model = new TagModel(stack) {
        protected Component getBean() {
          return new Userinfo(stack, authorityManager);
        }
      };
      models.put(Userinfo.class, model);
View Full Code Here

    library.authorityManager = authorityManager;
    return library;
  }

  public TagModel getGuard() {
    TagModel model = models.get(Guard.class);
    if (null == model) {
      model = new TagModel(stack) {
        protected Component getBean() {
          return new Guard(stack, authorityManager);
        }
      };
      models.put(Guard.class, model);
View Full Code Here

    }
    return model;
  }

  public TagModel getAvatar() {
    TagModel model = models.get(AvatarImage.class);
    if (null == model) {
      model = new TagModel(stack) {
        protected Component getBean() {
          return new AvatarImage(stack, authorityManager);
        }
      };
      models.put(AvatarImage.class, model);
View Full Code Here

    }
    return model;
  }
 
  public TagModel getUserinfo() {
    TagModel model = models.get(Userinfo.class);
    if (null == model) {
      model = new TagModel(stack) {
        protected Component getBean() {
          return new Userinfo(stack, authorityManager);
        }
      };
      models.put(Userinfo.class, model);
View Full Code Here

  public TagModel getA() {
    TagModel model = models.get(Anchor.class);
    if (null == model) {
      model = new TagModel(stack) {
        protected Component getBean() {
          return new Anchor(stack);
        }
      };
      models.put(Anchor.class, model);
    }
    return model;
View Full Code Here

  public TagModel getA() {
    TagModel model = models.get(Anchor.class);
    if (null == model) {
      model = new TagModel(stack) {
        protected Component getBean() {
          return new Anchor(stack);
        }
      };
      models.put(Anchor.class, model);
    }
    return model;
View Full Code Here

    }
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public Writer getWriter(Writer writer, Map params) throws TemplateModelException, IOException {
    Component bean = getBean();
    // Container container = (Container)
    // stack.getContext().get(ActionContext.CONTAINER);
    // container.inject(bean);
    BeansWrapper objectWrapper = BeansWrapper.getDefaultInstance();

    for (Iterator iterator = params.entrySet().iterator(); iterator.hasNext();) {
      Map.Entry<String, Object> entry = (Map.Entry<String, Object>) iterator.next();
      String key = entry.getKey();
      Object value = entry.getValue();
      if (value != null) {
        Method m = ComponentHelper.getWriteMethod(bean, key);
        if (null != m) {
          if (value instanceof TemplateModel) {
            try {
              value = objectWrapper.unwrap((TemplateModel) value);
            } catch (TemplateModelException e) {
              logger.error("failed to unwrap [" + value + "] it will be ignored", e);
            }
          }
          try {
            m.invoke(bean, value);
          } catch (Exception e) {
            e.printStackTrace();
          }
        } else {
          bean.getParameters().put(key, value);
        }
      }
    }
    return new ResetCallbackWriter(bean, writer);
  }
View Full Code Here

TOP

Related Classes of org.beangle.struts2.convention.route.Action

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.