當前位置: 首頁>>代碼示例>>Java>>正文


Java BodyContent.getString方法代碼示例

本文整理匯總了Java中javax.servlet.jsp.tagext.BodyContent.getString方法的典型用法代碼示例。如果您正苦於以下問題:Java BodyContent.getString方法的具體用法?Java BodyContent.getString怎麽用?Java BodyContent.getString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.servlet.jsp.tagext.BodyContent的用法示例。


在下文中一共展示了BodyContent.getString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doEndTag

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
public int doEndTag() {
	BodyContent body = this.getBodyContent();
	String html = body.getString() + "</html>";
	try {
		html = resource.replace(html);
	} catch (FisException e1) {
		// TODO Auto-generated catch block
		e1.printStackTrace();
	}
	JspWriter out = pageContext.getOut();
	try {
		out.write(html);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return EVAL_PAGE;
}
 
開發者ID:bignippleboy,項目名稱:ipaas,代碼行數:19,代碼來源:HtmlTag.java

示例2: doEndTag

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
@Override
public int doEndTag() throws JspException {
	// TODO Auto-generated method stub
	//�ڽ�����ǩʱ��ñ�ǩ�����ݣ�Ȼ�������޸�
	BodyContent bc=this.getBodyContent();
	String content=bc.getString();
	content=content.toUpperCase();
	try {
		this.pageContext.getOut().write(content);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		throw new RuntimeException(e);
	}
	return Tag.EVAL_PAGE;//����ֻ�ǶԱ�ǩ�����������޸ģ������jsp���ݻ�Ҫִ����ʾ������˴�����EVAL_PAGE
	//return super.doEndTag();
}
 
開發者ID:mushroomgithub,項目名稱:ServletStudyDemo,代碼行數:17,代碼來源:TagDemo4.java

示例3: doAfterBody

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
/**
 * Actions after some body has been evaluated.
 */
@Override
public int doAfterBody() throws JspTagException {

  // retrieve parent tag which accepts the result of this operation
  ValueAcceptingTagIF acceptingTag = (ValueAcceptingTagIF)
    findAncestorWithClass(this, ValueAcceptingTagIF.class);

  // get body content which should contain the string we want to set.
  BodyContent body = getBodyContent();
  String content = body.getString();

  // construct new collection which consists of one String entry
  // kick it over to the nearest accepting tag
  acceptingTag.accept( Collections.singleton(content) );

  // reset body contents
  body.clearBody();
  
  return SKIP_BODY;
}
 
開發者ID:ontopia,項目名稱:ontopia,代碼行數:24,代碼來源:StringTag.java

示例4: doAfterBody

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
/**
 * Actions after some body has been evaluated.
 */
@Override
public int doAfterBody() throws JspTagException {
  ElementTag elementTag = (ElementTag)
    findAncestorWithClass(this, ElementTag.class);

  if (elementTag != null) {
    // get body content
    BodyContent body = getBodyContent();
    if (body != null) {
      String content = body.getString();
      // add this attribute to parent element tag 
      elementTag.addAttribute(attrName, content);
      body.clearBody();
    } else {
      log.warn("AttributeTag: body content is null!");
    }
  } else {
    log.warn("AttributeTag: no parent element tag found!");
  }
  
  // only evaluate body once
  return SKIP_BODY;
}
 
開發者ID:ontopia,項目名稱:ontopia,代碼行數:27,代碼來源:AttributeTag.java

示例5: getHandlePageException

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
public static String getHandlePageException(PageContextImpl pc, PageException pe) throws PageException {
	BodyContent bc = null;
	String str = null;
	try {
		bc = pc.pushBody();
		pc.handlePageException(pe, false);
	}
	catch (Throwable t) {
		ExceptionUtil.rethrowIfNecessary(t);
		throw Caster.toPageException(t);
	} finally {
		if(bc != null)
			str = bc.getString();
		pc.popBody();
	}
	return str;
}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:18,代碼來源:PageContextUtil.java

示例6: tag

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
public static Result tag(PageContext pc, String cfml, int dialect, boolean catchOutput, boolean ignoreScopes) throws PageException {
	// execute
	Result res=new Result();
	BodyContent bc=null;
	//Variables before = pc.variablesScope();
	try{
		if(catchOutput)bc = pc.pushBody();
		//if(variables!=null)pc.setVariablesScope(variables);
		
		res.value=loadPage(pc.getConfig(), null, cfml,dialect,ignoreScopes).call(pc);
	}
	catch(Throwable t){
		ExceptionUtil.rethrowIfNecessary(t);
		throw Caster.toPageException(t);
	}
	finally{
		//if(variables!=null)pc.setVariablesScope(before);
		if(catchOutput) {
			if(bc!=null)res.output=bc.getString();
			pc.popBody();
		}
		//pc.flush();
	}
	return res;
}
 
開發者ID:lucee,項目名稱:Lucee,代碼行數:26,代碼來源:Renderer.java

示例7: doEndTag

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
@Override
public int doEndTag() {
    try {
        BodyContent body = getBodyContent();

        if (body != null) {
            JspWriter out = body.getEnclosingWriter();
            String bodyString = body.getString();
            body.clearBody();
            out.print(bodyString);
        }
    } catch (IOException e) {
        Debug.logInfo("IteratorTag IO Error", module);
        Debug.logInfo(e, module);
    }
    return EVAL_PAGE;
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:18,代碼來源:IteratorTag.java

示例8: doEndTag

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
@Override
public int doEndTag() {
    try {
        BodyContent body = getBodyContent();

        if (body != null) {
            JspWriter out = body.getEnclosingWriter();
            String bodyString = body.getString();
            body.clearBody();
            out.print(bodyString);
        }
    } catch (IOException e) {
        System.out.println("IterateNext Tag error: " + e);
    }
    return EVAL_PAGE;
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:17,代碼來源:IteratorHasNextTag.java

示例9: doEndTag

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
@Override
public int doEndTag() {
    try {
        BodyContent body = getBodyContent();

        if (body != null) {
            JspWriter out = body.getEnclosingWriter();
            String bodyString = body.getString();
            body.clearBody();
            //Debug.logInfo("printing string: " + bodyString, module);
            out.print(bodyString);
        }
    } catch (IOException e) {
        Debug.logError(e, "IfTag Error.", module);
    }
    return EVAL_PAGE;
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:18,代碼來源:IfTag.java

示例10: doEndTag

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
@Override
public int doEndTag() throws JspException {
    HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();

    BodyContent body = getBodyContent();
    String bodyString = body.getString();

    StringBuilder newURL = new StringBuilder();

    appendContentPrefix(request, newURL);
    newURL.append(bodyString);
    body.clearBody();

    try {
        getPreviousOut().print(newURL.toString());
    } catch (IOException 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 SKIP_BODY;
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:26,代碼來源:ContentUrlTag.java

示例11: doEndTag

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
@Override
public int doEndTag() throws JspException
{
   try
   {
      BodyContent bc = this.getBodyContent();
      String body = bc.getString();
      JspWriter out = this.pageContext.getOut();
      out.println("<body>");
      out.print(body);

      JSONStructure jsonStructure = new JSONStructure(0);
      this.marshaller.marschall(this.serializationData, jsonStructure);
      String json = jsonStructure.toString();

      out.println("<script>\nvar bz_davide_dm_widgets = " + json + "</script>");
      out.println("</body>");
      return BodyTagSupport.EVAL_PAGE;
   }
   catch (Exception exxx)
   {
      throw new JspException(exxx);
   }
}
 
開發者ID:davidebz,項目名稱:DMWeb,代碼行數:25,代碼來源:DMWebFragmentBodyTagLibrary.java

示例12: doEndTag

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
@Override
public int doEndTag() throws JspException {

	if (!isOverrided()) {
		BodyContent b = getBodyContent();
		if (b != null) {
			String content = b.getString();
			if (!TagUtils.isEmpty(content)) {
				pageContext.setAttribute(TAG_NAME + name, content);
			}
		}
	}
	return Tag.EVAL_PAGE;
}
 
開發者ID:KayuraTeam,項目名稱:kayura-tags,代碼行數:15,代碼來源:SectionTag.java

示例13: doEndTag

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
public int doEndTag() {
	HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
	FisResource resource = (FisResource) request.getAttribute(FisResource.CONTEXT_ATTR_NAME);
	BodyContent body = this.getBodyContent();
	String code = body.getString();
	resource.addScript(code);
	return EVAL_PAGE;
}
 
開發者ID:bignippleboy,項目名稱:ipaas,代碼行數:9,代碼來源:ScriptTag.java

示例14: _callCachedWithin

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
private Object _callCachedWithin(PageContext pc,Collection.Key calledName, Object[] args, Struct values,boolean doIncludePath) throws PageException {
  	PageContextImpl pci=(PageContextImpl) pc;
  	String id=CacheHandlerFactory.createId(this,args,values);
  	CacheHandler ch = ConfigWebUtil.getCacheHandlerFactories(pc.getConfig()).function.getInstance(pc.getConfig(), properties.cachedWithin);
CacheItem ci=ch.get(pc, id);

// get from cache
if(ci instanceof UDFCacheItem ) {
	UDFCacheItem entry = (UDFCacheItem)ci;
	//if(entry.creationdate+properties.cachedWithin>=System.currentTimeMillis()) {
		try {
			pc.write(entry.output);
		} catch (IOException e) {
			throw Caster.toPageException(e);
		}
		return entry.returnValue;
	//}
	
	//cache.remove(id);
}
  	
long start = System.nanoTime();
  	
// execute the function
BodyContent bc =  pci.pushBody();
   
   try {
   	Object rtn = _call(pci,calledName, args, values, doIncludePath);
   	String out = bc.getString();
   	
   	ch.set(pc, id,properties.cachedWithin,new UDFCacheItem(out, rtn,getFunctionName(),getPageSource().getDisplayPath(),System.nanoTime()-start));
	// cache.put(id, new UDFCacheEntry(out, rtn),properties.cachedWithin,properties.cachedWithin);
   	return rtn;
}
      finally {
      	BodyContentUtil.flushAndPop(pc,bc);
      }
  }
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:39,代碼來源:UDFImpl.java

示例15: doAfterBody

import javax.servlet.jsp.tagext.BodyContent; //導入方法依賴的package包/類
/**
 * Description of the Method
 *
 * @return Description of the Return Value
 * @throws JspException Description of the Exception
 */
public final int doAfterBody() throws JspException {
  try {
    // Display the body
    BodyContent bodyContent = getBodyContent();
    if (bodyContent != null) {
      title = bodyContent.getString();
    }
  } catch (Exception e) {
  }
  return SKIP_BODY;
}
 
開發者ID:Concursive,項目名稱:concourseconnect-community,代碼行數:18,代碼來源:PagedListStatusHandler.java


注:本文中的javax.servlet.jsp.tagext.BodyContent.getString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。