当前位置: 首页>>代码示例>>Java>>正文


Java TagSupport.findAncestorWithClass方法代码示例

本文整理汇总了Java中javax.servlet.jsp.tagext.TagSupport.findAncestorWithClass方法的典型用法代码示例。如果您正苦于以下问题:Java TagSupport.findAncestorWithClass方法的具体用法?Java TagSupport.findAncestorWithClass怎么用?Java TagSupport.findAncestorWithClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.servlet.jsp.tagext.TagSupport的用法示例。


在下文中一共展示了TagSupport.findAncestorWithClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doAfterBody

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
public int doAfterBody() {
	try {
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		OutputStreamWriter writer = new OutputStreamWriter(baos, "UTF-8");
		bodyContent.writeOut(writer);
		writer.flush();
		button.put("label", baos.toString("UTF-8"));
	} catch (IOException e) {
		e.printStackTrace();
	}

	DialogTag dialog = (DialogTag) TagSupport.findAncestorWithClass(this,
			DialogTag.class);
	dialog.addButton(button);
	button = new HashMap<String, String>();
	bodyContent.clearBody();

	return SKIP_BODY;
}
 
开发者ID:yangjm,项目名称:winlet,代码行数:20,代码来源:DialogButtonTag.java

示例2: doStartTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
@Override
public int doStartTag() throws JspException
{
  _parentELContext = (ELContextTag)
     TagSupport.findAncestorWithClass(this, ELContextTag.class);

  // Transform "rendered" on behalf of the UIComponentTag
  String rendered = _rendered;
  if (rendered != null)
  {
    if ((_parentELContext != null) && isValueReference(rendered))
      rendered = _parentELContext.transformExpression(rendered);

    super.setRendered(rendered);
  }


  String id = _id;
  if (id != null)
  {
    if (_parentELContext != null)
      id = _parentELContext.transformId(id);

    super.setId(id);
  }

  int retVal = super.doStartTag();

  //pu: There could have been some validation error during property setting
  //  on the bean, this is the closest opportunity to burst out.
  if (_validationError != null)
    throw new JspException(_validationError);

  return retVal;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:36,代码来源:UIXComponentTag.java

示例3: doStartTagInternal

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
@Override
protected final int doStartTagInternal() throws JspException {
	if (this.value != null) {
		// Find the containing EditorAwareTag (e.g. BindTag), if applicable.
		EditorAwareTag tag = (EditorAwareTag) TagSupport.findAncestorWithClass(this, EditorAwareTag.class);
		if (tag == null) {
			throw new JspException("TransformTag can only be used within EditorAwareTag (e.g. BindTag)");
		}

		// OK, let's obtain the editor...
		String result = null;
		PropertyEditor editor = tag.getEditor();
		if (editor != null) {
			// If an editor was found, edit the value.
			editor.setValue(this.value);
			result = editor.getAsText();
		}
		else {
			// Else, just do a toString.
			result = this.value.toString();
		}
		result = htmlEscape(result);
		if (this.var != null) {
			pageContext.setAttribute(this.var, result, TagUtils.getScope(this.scope));
		}
		else {
			try {
				// Else, just print it out.
				pageContext.getOut().print(result);
			}
			catch (IOException ex) {
				throw new JspException(ex);
			}
		}
	}

	return SKIP_BODY;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:39,代码来源:TransformTag.java

示例4: getParentEnumIteratorTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
/**
 * 
 * @return
 * @throws JspException
 */
protected EnumIteratorTag getParentEnumIteratorTag()
throws JspException
{
	try
       {
		return (EnumIteratorTag)TagSupport.findAncestorWithClass(this, EnumIteratorTag.class);
       } 
	catch (ClassCastException e)
       {
		throw new JspException("Parent tag of any derivation of AbstractEnumIteratorElementTag must be of type EnumIteratorTag");
       }
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:18,代码来源:AbstractEnumIteratorElementTag.java

示例5: getParentEnumIteratorTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
/**
 * 
 * @return
 * @throws JspException
 */
protected WellKnownOIDIteratorTag getParentEnumIteratorTag()
throws JspException
{
	try
       {
		return (WellKnownOIDIteratorTag)TagSupport.findAncestorWithClass(this, WellKnownOIDIteratorTag.class);
       } 
	catch (ClassCastException e)
       {
		throw new JspException("Parent tag of any derivation of AbstractEnumIteratorElementTag must be of type EnumIteratorTag");
       }
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:18,代码来源:WellKnownOIDElementSelectedTag.java

示例6: getParentSeriesListTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
private AbstractSeriesCollectionTag getParentSeriesListTag()
throws JspException
{
	try
       {
        return (AbstractSeriesCollectionTag)TagSupport.findAncestorWithClass(this, AbstractSeriesCollectionTag.class);
       } 
	catch (ClassCastException e)
       {
		throw new JspException("SeriesCollectionElementTag must have an ancestor of type AbstractSeriesListTag");
       }
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:13,代码来源:SeriesCollectionElementTag.java

示例7: getParentSeriesTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
private AbstractSeriesTag getParentSeriesTag()
throws JspException
{
	try
       {
		return (AbstractSeriesTag)TagSupport.findAncestorWithClass(this, AbstractSeriesTag.class);
       } 
	catch (ClassCastException e)
       {
		throw new JspException("Parent tag of AbstractSeriesPropertyTag must be of type AbstractSeriesTag");
       }
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:13,代码来源:AbstractSeriesPropertyTag.java

示例8: getParentImageTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
private AbstractImageTag getParentImageTag()
throws JspException
{
	try
       {
		return (AbstractImageTag)TagSupport.findAncestorWithClass(this, AbstractImageTag.class);
       } 
	catch (ClassCastException e)
       {
		throw new JspException("Parent tag of AbstractImagePropertyTag must be of type AbstractImageTag");
       }
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:13,代码来源:AbstractImagePropertyTag.java

示例9: doStartTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
@Override
public int doStartTag() throws JspException {
    try {
        if (this.bundle == null) {
            I18nBundleTag bundleTag = (I18nBundleTag) TagSupport.findAncestorWithClass(this, I18nBundleTag.class);

            if (bundleTag != null) {
                this.bundle = bundleTag.getBundle();
            }
        }

        if (this.bundle != null) this.value = this.bundle.getString(this.key);

        /* this is a bad assumption, it won't necessarily be an ISO8859_1 charset, much better to just use the string as is
        this.value = new String(s.getBytes("ISO8859_1"));
         */
    } catch (Exception e) {
        if (UtilJ2eeCompat.useNestedJspException(pageContext.getServletContext())) {
            throw new JspException(e.getMessage(), e);
        } else {
            Debug.logError(e, "Server does not support nested exceptions, here is the exception", module);
            throw new JspException(e.toString());
        }
    }

    return EVAL_BODY_AGAIN;
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:28,代码来源:I18nMessageTag.java

示例10: getParentSeriesTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
private AbstractSeriesTag getParentSeriesTag()
throws JspException
{
	try
       {
        return (AbstractSeriesTag)TagSupport.findAncestorWithClass(this, AbstractSeriesTag.class);
       } 
	catch (ClassCastException e)
       {
		throw new JspException("SeriesImageCollectionTag must have an ancestor  of type AbstractSeriesTag");
       }
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:13,代码来源:SeriesImageCollectionTag.java

示例11: getParentListTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
private AbstractStudyListTag getParentListTag()
throws JspException
{
	try
       {
		return (AbstractStudyListTag)TagSupport.findAncestorWithClass(this, AbstractStudyListTag.class);
       } 
	catch (ClassCastException e)
       {
		throw new JspException("StudyListElementTag must have an ancestor of type AbstractStudyListTag");
       }
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:13,代码来源:StudyListElementTag.java

示例12: doEndTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
/**
 * 
 * @see PortletTag
 */
public int doEndTag() throws JspException {

   // Ensure that the portlet render tag resides within a portlet tag.
   PortletTag parentTag = (PortletTag) TagSupport.findAncestorWithClass(this, PortletTag.class);
   if (parentTag == null) {
      throw new JspException("Portlet render tag may only reside " + "within a pluto:portlet tag.");
   }

   // If the portlet is rendered successfully, print the rendering result.

   try {
      if (parentTag.getStatus() == PortletTag.SUCCESS) {
         StringBuffer buffer = parentTag.getPortalServletResponse().getInternalBuffer().getBuffer();
         pageContext.getOut().print(buffer.toString());
      } else {

         // Otherwise, print the error messages

         List<String> msgs = parentTag.getMessages();

         if (msgs.isEmpty()) {
            pageContext.getOut().print(" Unknown error rendering portlet.");
         } else {

            for (String msg : msgs) {
               pageContext.getOut().print("<p>");
               pageContext.getOut().print(msg);
               pageContext.getOut().print("</p>");
            }
         }
      }
   } catch (IOException ex) {
      throw new JspException(ex);
   }

   // Return.
   return SKIP_BODY;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:43,代码来源:PortletRenderTag.java

示例13: doEndTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
/**
 * ${@inheritDoc}
 */
public int doEndTag() throws JspException {
    ListCommand cmd = ListTagUtil.getCurrentCommand(this, pageContext);
    ListTag parent = (ListTag) TagSupport.findAncestorWithClass(this, ListTag.class);
    if (cmd.equals(ListCommand.TBL_ADDONS) && role.equals("header")) {
        renderHeader(parent);
    }
    else if (cmd.equals(ListCommand.BEFORE_RENDER) && role.equals("footer")) {
        renderFooter(parent);
    }
    return TagSupport.EVAL_PAGE;
}
 
开发者ID:spacewalkproject,项目名称:spacewalk,代码行数:15,代码来源:SpanTag.java

示例14: doEndTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
/**
 * When reach the end tag, fire this operation
 * 
 * @see javax.servlet.jsp.tagext.BodyTagSupport#doEndTag()
 */
public int doEndTag( ) throws JspException
{
	if ( param.validate( ) )
	{
		// included in viewer tag
		AbstractViewerTag viewerTag = (AbstractViewerTag) TagSupport
				.findAncestorWithClass( this, AbstractViewerTag.class );
		if ( viewerTag != null )
			viewerTag.addParameter( param );
	}
	return super.doEndTag( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:ParamTag.java

示例15: doEndTag

import javax.servlet.jsp.tagext.TagSupport; //导入方法依赖的package包/类
/**
 * When reach the end tag, fire this operation
 * 
 * @see javax.servlet.jsp.tagext.BodyTagSupport#doEndTag()
 */
public int doEndTag( ) throws JspException
{
	try
	{
		if ( __validate( ) )
		{
			// included in parameterpage tag
			this.requesterTag = (RequesterTag) TagSupport
					.findAncestorWithClass( this, RequesterTag.class );
			if ( requesterTag != null )
			{
				this.viewer = requesterTag.viewer;
				if ( this.viewer.isCustom( ) )
				{
					__beforeEndTag( );
					__process( );
				}
			}
		}
	}
	catch ( Exception e )
	{
		__handleException( e );
	}
	return super.doEndTag( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:32,代码来源:ParamDefTag.java


注:本文中的javax.servlet.jsp.tagext.TagSupport.findAncestorWithClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。