本文整理汇总了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;
}
示例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;
}
示例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");
}
}
示例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'> </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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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 = "…" + myString.subSequence(Math.max(myString.length() - maxLength, 0),
myString.length());
else
substr = myString.subSequence(0, maxLength) + "…";
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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}