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


Java JspTagException类代码示例

本文整理汇总了Java中javax.servlet.jsp.JspTagException的典型用法代码示例。如果您正苦于以下问题:Java JspTagException类的具体用法?Java JspTagException怎么用?Java JspTagException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
/**
 * Does two things:
 * <ul>
 *      <li>Stops the page if the corresponding attribute has been set</li>
 *      <li>Prints a message another tag encloses this one.</li>
 * </ul>
 */
public int doEndTag() throws JspTagException
{
    //get the parent if any
    Tag parent = this.getParent();

    if (parent != null) {
        try {
            JspWriter out = this.pageContext.getOut();
            out.println("This tag has a parent. <BR>");

        } catch (IOException e) {
            throw new JspTagException(e.getMessage());
        }
    }

    if (this.stopPage) {

        return Tag.SKIP_PAGE;
    }

    return Tag.EVAL_PAGE;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:30,代码来源:SampleTag.java

示例2: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
public int doEndTag() throws JspException {

        // Rewrite and encode the url.
        String result = formatUrl();

        // Store or print the output
        if (var != null)
            pageContext.setAttribute(var, result, PageContext.PAGE_SCOPE);
        else {
            try {
                pageContext.getOut().print(result);
            } catch (IOException x) {
                throw new JspTagException(x);
            }
        }
        return EVAL_PAGE;
    }
 
开发者ID:airsonic,项目名称:airsonic,代码行数:18,代码来源:UrlTag.java

示例3: _validateAttributes

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
private void _validateAttributes(
  ) throws JspTagException
{
  // Ensure that the begin and and have been specified if the items attribute was not
  if (null == _items)
  {
    if (null == _begin || null == _end)
    {
      throw new JspTagException(
        "'begin' and 'end' should be specified if 'items' is not specified");
    }
  }

  // Ensure the user has not set the var and varStatus attributes to the save value
  if ((_var != null) && _var.equals(_varStatus))
  {
    throw new JspTagException(
      "'var' and 'varStatus' should not have the same value");
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:21,代码来源:ForEachTag.java

示例4: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
public int doEndTag() throws JspException {
	if (getParent()!=null && getParent() instanceof SectionHeader) {
		((SectionHeader)getParent()).setTitle(getBodyContent().getString());
	} else {
		try {
			String body = (getBodyContent()==null?null:getBodyContent().getString());
			if (body==null || body.trim().length()==0) {
				pageContext.getOut().println("<DIV class='WelcomeRowHeadBlank'>&nbsp;</DIV>");
			} else {
				pageContext.getOut().println("<DIV class='WelcomeRowHead'>");
				pageContext.getOut().println(body);
				pageContext.getOut().println("</DIV>");
			}
		} catch (Exception e) {
			e.printStackTrace();
			throw new JspTagException(e.getMessage());
		}
	}
	return EVAL_PAGE;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:21,代码来源:SectionTitle.java

示例5: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
public int doEndTag() throws JspException {
    try {
        String body = (getBodyContent()==null?null:getBodyContent().getString());
        if (body==null || body.trim().length()==0) body = "Are you sure?";
        pageContext.getOut().println("<SCRIPT language='javascript'>");
        pageContext.getOut().println("<!--");
        pageContext.getOut().println("function "+getName()+"() {");
        if (JavascriptFunctions.isJsConfirm(getSessionContext())) {
            pageContext.getOut().println("return confirm(\""+body+"\");");
        } else {
            pageContext.getOut().println("return true;");
        }
        pageContext.getOut().println("}");
        pageContext.getOut().println("// -->");
        pageContext.getOut().println("</SCRIPT>");
    } catch (Exception e) {
        e.printStackTrace();
        throw new JspTagException(e.getMessage());
    }
    return EVAL_PAGE;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:22,代码来源:Confirm.java

示例6: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
@Override
public int doEndTag() throws JspException {
    JspWriter out = pageContext.getOut();

    try {
        if (!"-1".equals(objectValue)) {
            out.print(objectValue);
        } else if (!"-1".equals(stringValue)) {
            out.print(stringValue);
        } else if (longValue != -1) {
            out.print(longValue);
        } else if (doubleValue != -1) {
            out.print(doubleValue);
        } else {
            out.print("-1");
        }
    } catch (IOException ex) {
        throw new JspTagException("IOException: " + ex.toString(), ex);
    }
    return super.doEndTag();
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:22,代码来源:ValuesTag.java

示例7: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
public int doEndTag() throws JspTagException {
    try {
        JspWriter out = this.pageContext.getOut();
        String menu = (String) this.pageContext.getSession().getAttribute("menu");
        if (menu != null) {
            out.print(menu);
        } else {
            menu = end().toString();
            out.print(menu);
        }

    } catch (IOException e) {
        e.printStackTrace();
    }
    return EVAL_PAGE;
}
 
开发者ID:ansafari,项目名称:melon,代码行数:17,代码来源:MenuTag.java

示例8: doStartTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
public int doStartTag() throws JspException {
	try {
		HttpSession se = ((HttpServletRequest) pc.getRequest()).getSession();
		String p = (String) se.getAttribute("OscarPageURL");

		if (p == null || p.equals("")) {
			pc.getOut().print("");
		} else {
			p = p.substring(0, p.indexOf("/provider"));
			p += "/demographic/demographiccontrol.jsp?displaymode=edit&dboperation=search_detail&demographic_no=" + demographicNo;
			String temps = "<a href=\"javascript.void(0);\" onclick=\"window.open('" + p + "','demographic');return false;\">OSCAR Master File</a>";
			pc.getOut().print(temps);
		}

	} catch (Exception e) {
		throw new JspTagException("An IOException occurred.");
	}
	
	return SKIP_BODY;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:21,代码来源:OscarDemographicLinkTag.java

示例9: doStartTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
public int doStartTag() throws JspException {
	try {
		HttpSession se = ((HttpServletRequest) pc.getRequest()).getSession();
		String p = (String) se.getAttribute("OscarPageURL");
		String q = (String) se.getAttribute("OscarPageQuery");

		if (p == null) {
			pc.getOut().print("");
		} else if (p.equals("")) {
			pc.getOut().print("");
		} else {
			p = p.substring(0, p.lastIndexOf("/") + 1) + "providercontrol.jsp?" + q;
			String temps = "<a href='" + p + "'>Oscar Medical</a>";
			pc.getOut().print(temps);
		}

	} catch (Exception e) {
		throw new JspTagException("An IOException occurred.");
	}
	
	return SKIP_BODY;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:23,代码来源:OscarTag.java

示例10: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public int doEndTag() throws JspException {
    String key = null;
    if (keySpecified) {
        key = keyAttrValue;
    } else if (bodyContent != null && bodyContent.getString() != null) {
        key = bodyContent.getString().trim();
    }

    String message = ResourceBundleManager.instance().getText(key, getLocale(),
            params.toArray());
    if (var != null) {
        pageContext.setAttribute(var, message, scope);
    } else {
        try {
            pageContext.getOut().print(message);
        } catch (IOException ioe) {
            throw new JspTagException(ioe.toString(), ioe);
        }
    }

    return EVAL_PAGE;
}
 
开发者ID:Communote,项目名称:communote-server,代码行数:27,代码来源:FmtMessageTag.java

示例11: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
public int doEndTag() throws javax.servlet.jsp.JspTagException {
    try {
        if (myString.length() > maxLength) {
            CharSequence substr;

            if (reversed)
                substr = "&hellip;" + myString.subSequence(Math.max(myString.length() - maxLength, 0),
                        myString.length());
            else
                substr = myString.subSequence(0, maxLength) + "&hellip;";

            pageContext.getOut().write("<span title='" + myString + "'>" + substr + "</span>");
        } else {
            pageContext.getOut().write(myString);
        }
    } catch (java.io.IOException e) {
        throw new JspTagException("IO Error: " + e.getMessage());
    }
    return EVAL_PAGE;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:21,代码来源:StringAbbreviator.java

示例12: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
@Override
public int doEndTag() throws JspTagException {
    try {
        String tagId = "profile" + Long.toString(System.currentTimeMillis());
        StringBuilder fullHTML = new StringBuilder();
        fullHTML.append("<div class=\"profile\">");
        String profileContent = getSourceViewJSON(profile); //since JSON is now the primary format, we try this first
        if (profileContent == null) {
            profileContent = getListViewHTML(profile); 
        }
        if (profileContent == null) {
            profileContent = getSourceViewHTML(profile); 
        }
        fullHTML.append("   <div id=\"profileHTML-").append(tagId).append("\">");
        fullHTML.append(profileContent);
        fullHTML.append("   </div>");
        fullHTML.append("</div>");

        pageContext.getOut().write(fullHTML.toString());
    } catch (java.io.IOException e) {
        throw new JspTagException("IO Error: " + e.getMessage());
    }
    return EVAL_PAGE;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:25,代码来源:ProfileRenderer.java

示例13: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
public int doEndTag() throws JspException {

        if (this.remoteTenantDAO == null) {
            ServletContext servletContext = this.pageContext.getServletContext();
            ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
            this.remoteTenantDAO= (RemoteTenantDAO) context.getBean("remoteTenantDAO");
        }

        try {
            RemoteTenant rt = this.remoteTenantDAO.get(operatorId, tenantId);
            String stringRep = Text.matchMax(rt.getUrl(), itemUrl);
            String result = encodeForHTMLAttribute(stringRep);
            this.pageContext.getOut().write(result);
        } catch (java.io.IOException e) {
            throw new JspTagException("IO Error: " + e.getMessage());
        }
        return EVAL_PAGE;
    }
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:19,代码来源:AbsoluteUrl.java

示例14: doEndTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
@Override
public int doEndTag() throws JspTagException {
	try {
		WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext());//获取SPRING的上下文
		StoreService storeService = (StoreService) ctx.getBean("storeService");
		Stores stores =  storeService.findById(Long.parseLong(id));
		if(stores!=null){
			pageContext.getOut().write(stores.getName());
		}else if(id.equals("0")){
			pageContext.getOut().write("<b>超级管理员</b>");
		}else{
			pageContext.getOut().write("<b>项目已不存在</b>");

		}
	} catch (IOException e) {
		e.printStackTrace();
	}
	return EVAL_PAGE;
}
 
开发者ID:pengqiuyuan,项目名称:g2,代码行数:20,代码来源:GetStoreNameTag.java

示例15: doStartTag

import javax.servlet.jsp.JspTagException; //导入依赖的package包/类
public int doStartTag() throws JspException {
    initServices();
    HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
    
    String returnValue = staticAssetService.convertAssetPath(value, request.getContextPath(), isRequestSecure());

    if (var != null) {
        pageContext.setAttribute(var, returnValue);
    } else {
        try {
            pageContext.getOut().print(returnValue);
        } catch (IOException ioe) {
            throw new JspTagException(ioe.toString(), ioe);
        }
    }

    return EVAL_PAGE;
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:19,代码来源:UrlRewriteTag.java


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