GroupOptionTagSupport.java 文件源码

java
阅读 41 收藏 0 点赞 0 评论 0

项目:Runway-SDK 作者:
@Override
public void doTag() throws JspException, IOException
{
  JspTag parent = SimpleTagSupport.findAncestorWithClass(this, GroupTagSupport.class);
  JspWriter out = this.getJspContext().getOut();

  if (parent != null)
  {
    GroupTagSupport group = (GroupTagSupport) parent;
    String name = group.getParam();
    String type = group.getType();

    JspTag component = findAncestorWithClass(this, ComponentMarkerIF.class);

    // If the combo box is used in the context of a component then
    // the generated parameter name needs to prefix the name of the component
    if (component != null)
    {
      name = ( (ComponentMarkerIF) component ).getParam() + "." + name;
    }

    MutableDTO current = group.getItem();
    String valueAttribute = group.getValueAttribute();

    this.addAttribute("type", type);
    this.addAttribute("name", name);
    this.addAttribute("value", current.getValue(valueAttribute));

    this.openTag("input", out);

    if (this.getJspBody() != null)
    {
      this.getJspBody().invoke(null);
    }

    this.closeTag("input", out);
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号