javax.servlet.jsp.tagext.Tag.setPageContext()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中javax.servlet.jsp.tagext.Tag.setPageContext()方法的一些代码示例,展示了Tag.setPageContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tag.setPageContext()方法的具体详情如下:
包路径:javax.servlet.jsp.tagext.Tag
类名称:Tag
方法名:setPageContext

Tag.setPageContext介绍

[英]Set the current page context. This method is invoked by the JSP page implementation object prior to doStartTag().

This value is not reset by doEndTag() and must be explicitly reset by a page implementation if it changes between calls to doStartTag().
[中]设置当前页面上下文。此方法由doStartTag()之前的JSP页面实现对象调用。
此值由doEndTag()重置,如果在调用doStartTag()之间发生更改,则必须由页面实现显式重置。

代码示例

代码示例来源:origin: org.freemarker/freemarker

Tag parentTag = (Tag) pageContext.peekTopTag(Tag.class);
tag.setParent(parentTag);
tag.setPageContext(pageContext);
setupTag(tag, args, pageContext.getObjectWrapper());

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.3-j2ee1.3

/**
 * Constructor for a tag with the specified attribute map.
 * If the specified tag is not an instance of <code>TagSupport</code>,
 * the methods that delegate to <code>TagSupport</code> specific methods
 * throw an exception.
 * @param tag the tag
 * @param pageContext the corresponding <code>PageContext</code>
 * @param attributes the attribute map
 */
public NestedStandardTag(Tag tag, PageContext pageContext, Map attributes)
{
  this.tag = tag;
  this.pageContext = pageContext;
  tag.setPageContext(pageContext);
  childs = new ArrayList();
  this.attributes = attributes;
  doRelease = false;
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.4-j2ee1.3

/**
 * Constructor for a tag with the specified attribute map.
 * If the specified tag is not an instance of <code>TagSupport</code>,
 * the methods that delegate to <code>TagSupport</code> specific methods
 * throw an exception.
 * @param tag the tag
 * @param pageContext the corresponding <code>PageContext</code>
 * @param attributes the attribute map
 */
public NestedStandardTag(Tag tag, PageContext pageContext, Map attributes)
{
  this.tag = tag;
  this.pageContext = pageContext;
  tag.setPageContext(pageContext);
  childs = new ArrayList();
  this.attributes = attributes;
  doRelease = false;
}

代码示例来源:origin: com.mockrunner/mockrunner-tag

/**
 * Constructor for a tag with the specified attribute map.
 * If the specified tag is not an instance of <code>TagSupport</code>,
 * the methods that delegate to <code>TagSupport</code> specific methods
 * throw an exception.
 * @param tag the tag
 * @param pageContext the corresponding <code>PageContext</code>
 * @param attributes the attribute map
 */
public NestedStandardTag(Tag tag, PageContext pageContext, Map attributes)
{
  this.tag = tag;
  this.pageContext = pageContext;
  tag.setPageContext(pageContext);
  childs = new ArrayList();
  this.attributes = attributes;
  doRelease = false;
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.3-j2ee1.3

/**
 * Delegates to wrapped tag. Also calls <code>setPageContext</code>
 * for all child tags.
 */
public void setPageContext(PageContext pageContext)
{
  this.pageContext = pageContext;
  tag.setPageContext(pageContext);
  for(int ii = 0; ii < childs.size(); ii++)
  {
    Object child = childs.get(ii);
    if(child instanceof Tag)
    {
      ((Tag)child).setPageContext(pageContext);
    }
    /*else if(child instanceof SimpleTag)
    {
      ((SimpleTag)child).setJspContext(pageContext);
    }*/
  }
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.4-j2ee1.3

/**
 * Delegates to wrapped tag. Also calls <code>setPageContext</code>
 * for all child tags.
 */
public void setPageContext(PageContext pageContext)
{
  this.pageContext = pageContext;
  tag.setPageContext(pageContext);
  for(int ii = 0; ii < childs.size(); ii++)
  {
    Object child = childs.get(ii);
    if(child instanceof Tag)
    {
      ((Tag)child).setPageContext(pageContext);
    }
    /*else if(child instanceof SimpleTag)
    {
      ((SimpleTag)child).setJspContext(pageContext);
    }*/
  }
}

代码示例来源:origin: com.mockrunner/mockrunner-tag

/**
 * Delegates to wrapped tag. Also calls <code>setPageContext</code>
 * for all child tags.
 */
public void setPageContext(PageContext pageContext)
{
  this.pageContext = pageContext;
  tag.setPageContext(pageContext);
  for (Object child : childs) {
    if (child instanceof Tag) {
      ((Tag) child).setPageContext(pageContext);
    } else if (child instanceof SimpleTag) {
      ((SimpleTag) child).setJspContext(pageContext);
    }
  }
}

代码示例来源:origin: com.pojosontheweb/ttt-stripes

public TagTemplate(PageContext pageContext, T tag, B parent) {
  this.tag = tag;
  tag.setPageContext(pageContext);
  if (parent != null) {
    tag.setParent(parent);
  }
}

代码示例来源:origin: com.mockrunner/mockrunner-tag

/**
 * Sets the <code>JspContext</code>. Also calls <code>setJspContext</code>
 * (or <code>setPageContext</code>) for all child tags.
 * <code>setPageContext</code> is only called if the specified <code>JspContext</code>
 * is an instance of <code>PageContext</code>.
 * @param jspContext the <code>JspContext</code>
 */
public void setJspContext(JspContext jspContext)
{
  this.jspContext = jspContext;
  for (Object child : childs) {
    if (child instanceof Tag && jspContext instanceof PageContext) {
      ((Tag) child).setPageContext((PageContext) jspContext);
    } else if (child instanceof SimpleTag) {
      ((SimpleTag) child).setJspContext(jspContext);
    }
  }
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.4-j2ee1.3

/**
 * Delegates to wrapped tag. Also calls <code>setPageContext</code>
 * for all child tags.
 */
public void setPageContext(PageContext pageContext)
{
  this.pageContext = pageContext;
  tag.setPageContext(pageContext);
  for(int ii = 0; ii < childs.size(); ii++)
  {
    Object child = childs.get(ii);
    if(child instanceof Tag)
    {
      ((Tag)child).setPageContext(pageContext);
    }
    /*else if(child instanceof SimpleTag)
    {
      ((SimpleTag)child).setJspContext(pageContext);
    }*/
  }
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.3-j2ee1.3

/**
 * Delegates to wrapped tag. Also calls <code>setPageContext</code>
 * for all child tags.
 */
public void setPageContext(PageContext pageContext)
{
  this.pageContext = pageContext;
  tag.setPageContext(pageContext);
  for(int ii = 0; ii < childs.size(); ii++)
  {
    Object child = childs.get(ii);
    if(child instanceof Tag)
    {
      ((Tag)child).setPageContext(pageContext);
    }
    /*else if(child instanceof SimpleTag)
    {
      ((SimpleTag)child).setJspContext(pageContext);
    }*/
  }
}

代码示例来源:origin: mockobjects/mockobjects-jdk1.4-j2ee1.3

/**
 * Assert that the return value of doStartTag is equal to an expectedValue
 * @param expectedValue value to check against doStartTag
 */
public void assertDoStartTag(final int expectedValue) throws JspException {
  testSubject.setPageContext(pageContext);
  checkReturnValue("doStartTag", expectedValue, testSubject.doStartTag());
}

代码示例来源:origin: com.mockrunner/mockrunner-tag

/**
 * Delegates to wrapped tag. Also calls <code>setPageContext</code>
 * for all child tags.
 */
public void setPageContext(PageContext pageContext)
{
  this.pageContext = pageContext;
  tag.setPageContext(pageContext);
  for (Object child : childs) {
    if (child instanceof Tag) {
      ((Tag) child).setPageContext(pageContext);
    } else if (child instanceof SimpleTag) {
      ((SimpleTag) child).setJspContext(pageContext);
    }
  }
}

代码示例来源:origin: org.seasar.teeda/teeda-extension

protected void setUpTag(final FacesContext context,
    final PageContext pageContext, final Tag tag, final Tag parentTag)
    throws JspException {
  if (parentTag != null) {
    tag.setParent(parentTag);
  }
  tag.setPageContext(pageContext);
  setupProperties(tag);
  composeComponentTreeChildren(context, pageContext, tag);
}

代码示例来源:origin: org.seasar.mayaa/mayaa

protected Tag getLoadedTag() {
  Tag tag = (Tag) CycleUtil.getLocalVariable(LOADED_TAG_KEY, this, null);
  if (tag == null) {
    tag = getTagPool().borrowTag();
    tag.setPageContext(_pageContext);
    CycleUtil.setLocalVariable(LOADED_TAG_KEY, this, tag);
  }
  return tag;
}

代码示例来源:origin: org.seasar.teeda/teeda-extension

protected void process(final PageContext pageContext, final Tag tag,
    final Tag parentTag) throws JspException {
  if (parentTag != null) {
    tag.setParent(parentTag);
  }
  tag.setPageContext(pageContext);
  setupProperties(tag);
  if (tag instanceof BodyTag) {
    processBodyTag(pageContext, (BodyTag) tag);
  } else if (tag instanceof IterationTag) {
    processIterationTag(pageContext, (IterationTag) tag);
  } else {
    processTag(pageContext, tag);
  }
}

代码示例来源:origin: org.metawidget.modules/metawidget-all

private static void writeTagInternal( PageContext context, Tag tag, Tag parentTag )
  throws JspException {
  tag.setPageContext( context );
  tag.setParent( parentTag );

代码示例来源:origin: org.freemarker/freemarker-gae

Tag parentTag = (Tag) pageContext.peekTopTag(Tag.class);
tag.setParent(parentTag);
tag.setPageContext(pageContext);
setupTag(tag, args, pageContext.getObjectWrapper());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker

Tag parentTag = (Tag) pageContext.peekTopTag(Tag.class);
tag.setParent(parentTag);
tag.setPageContext(pageContext);
setupTag(tag, args, pageContext.getObjectWrapper());

代码示例来源:origin: org.freemarker/com.springsource.freemarker

Tag parentTag = (Tag)pageContext.peekTopTag(Tag.class);
tag.setParent(parentTag);
tag.setPageContext(pageContext);
setupTag(tag, args, pageContext.getObjectWrapper());

相关文章