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


Java JasperException类代码示例

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


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

示例1: appendTagDirective

import org.apache.jasper.JasperException; //导入依赖的package包/类
private void appendTagDirective(Node.TagDirective n) throws JasperException {

			boolean append = false;
			Attributes attrs = n.getAttributes();
			int len = (attrs == null) ? 0 : attrs.getLength();
			for (int i = 0; i < len; i++) {
				@SuppressWarnings("null") // If attrs==null, len == 0
				String attrName = attrs.getQName(i);
				if (!"pageEncoding".equals(attrName)) {
					append = true;
					break;
				}
			}
			if (!append) {
				return;
			}

			appendTag(n);
		}
 
开发者ID:how2j,项目名称:lazycat,代码行数:20,代码来源:PageDataImpl.java

示例2: genPreambleClassVariableDeclarations

import org.apache.jasper.JasperException; //导入依赖的package包/类
/**
 * Declare tag handler pools (tags of the same type and with the same
 * attribute set share the same tag handler pool) (shared by servlet and tag
 * handler preamble generation)
 *
 * In JSP 2.1, we also scope an instance of ExpressionFactory
 */
private void genPreambleClassVariableDeclarations(String className)
        throws JasperException {
    if (isPoolingEnabled && !tagHandlerPoolNames.isEmpty()) {
        for (int i = 0; i < tagHandlerPoolNames.size(); i++) {
            out.printil("private org.apache.jasper.runtime.TagHandlerPool "
                    + tagHandlerPoolNames.elementAt(i) + ";");
        }
        out.println();
    }
    out.printin("private javax.el.ExpressionFactory ");
    out.print(VAR_EXPRESSIONFACTORY);
    out.println(";");
    out.printin("private org.apache.InstanceManager ");
    out.print(VAR_INSTANCEMANAGER);
    out.println(";");
    out.println();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:Generator.java

示例3: parseEmptyBody

import org.apache.jasper.JasperException; //导入依赖的package包/类
private void parseEmptyBody(Node parent, String tag) throws JasperException {
    if (reader.matches("/>")) {
        // Done
    } else if (reader.matches(">")) {
        if (reader.matchesETag(tag)) {
            // Done
        } else if (reader.matchesOptionalSpacesFollowedBy("<jsp:attribute")) {
            // Parse the one or more named attribute nodes
            parseNamedAttributes(parent);
            if (!reader.matchesETag(tag)) {
                // Body not allowed
                err.jspError(reader.mark(),
                        "jsp.error.jspbody.emptybody.only", "&lt;" + tag);
            }
        } else {
            err.jspError(reader.mark(), "jsp.error.jspbody.emptybody.only",
                    "&lt;" + tag);
        }
    } else {
        err.jspError(reader.mark(), "jsp.error.unterminated", "&lt;" + tag);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:Parser.java

示例4: getValueFromPropertyEditorManager

import org.apache.jasper.JasperException; //导入依赖的package包/类
public static Object getValueFromPropertyEditorManager(Class<?> attrClass, String attrName, String attrValue)
		throws JasperException {
	try {
		PropertyEditor propEditor = PropertyEditorManager.findEditor(attrClass);
		if (propEditor != null) {
			propEditor.setAsText(attrValue);
			return propEditor.getValue();
		} else {
			throw new IllegalArgumentException(
					Localizer.getMessage("jsp.error.beans.propertyeditor.notregistered"));
		}
	} catch (IllegalArgumentException ex) {
		throw new JasperException(Localizer.getMessage("jsp.error.beans.property.conversion", attrValue,
				attrClass.getName(), attrName, ex.getMessage()));
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:17,代码来源:JspRuntimeLibrary.java

示例5: addInclude

import org.apache.jasper.JasperException; //导入依赖的package包/类
/**
 * Add a list of files. This is used for implementing include-prelude and
 * include-coda of jsp-config element in web.xml
 */
private void addInclude(Node parent, List files) throws JasperException {
    if (files != null) {
        Iterator iter = files.iterator();
        while (iter.hasNext()) {
            String file = (String) iter.next();
            AttributesImpl attrs = new AttributesImpl();
            attrs.addAttribute("", "file", "file", "CDATA", file);

            // Create a dummy Include directive node
            Node includeNode = new Node.IncludeDirective(attrs, reader
                    .mark(), parent);
            processIncludeDirective(file, includeNode);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:Parser.java

示例6: parseOptionalBody

import org.apache.jasper.JasperException; //导入依赖的package包/类
private void parseOptionalBody(Node parent, String tag, String bodyType)
        throws JasperException {
    if (reader.matches("/>")) {
        // EmptyBody
        return;
    }

    if (!reader.matches(">")) {
        err.jspError(reader.mark(), "jsp.error.unterminated", "&lt;" + tag);
    }

    if (reader.matchesETag(tag)) {
        // EmptyBody
        return;
    }

    if (!parseJspAttributeAndBody(parent, tag, bodyType)) {
        // Must be ( '>' # Body ETag )
        parseBody(parent, tag, bodyType);
    }
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:22,代码来源:Parser.java

示例7: postCheck

import org.apache.jasper.JasperException; //导入依赖的package包/类
/**
 * Perform miscellaneous checks after the nodes are visited.
 */
void postCheck() throws JasperException {
    // Check that var.name-from-attributes has valid values.
    for (Entry<String, NameEntry> entry : nameFromTable.entrySet()) {
        String key = entry.getKey();
        NameEntry nameEntry = nameTable.get(key);
        NameEntry nameFromEntry = entry.getValue();
        Node nameFromNode = nameFromEntry.getNode();
        if (nameEntry == null) {
            err.jspError(nameFromNode,
                    "jsp.error.tagfile.nameFrom.noAttribute", key);
        } else {
            Node node = nameEntry.getNode();
            TagAttributeInfo tagAttr = nameEntry.getTagAttributeInfo();
            if (!"java.lang.String".equals(tagAttr.getTypeName())
                    || !tagAttr.isRequired()
                    || tagAttr.canBeRequestTime()) {
                err.jspError(nameFromNode,
                        "jsp.error.tagfile.nameFrom.badAttribute",
                        key, Integer.toString(node.getStart()
                                .getLineNumber()));
            }
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:28,代码来源:TagFileProcessor.java

示例8: nextChar

import org.apache.jasper.JasperException; //导入依赖的package包/类
int nextChar() throws JasperException {
    if (!hasMoreInput())
        return -1;
    
    int ch = current.stream[current.cursor];

    current.cursor++;
    
    if (ch == '\n') {
        current.line++;
        current.col = 0;
    } else {
        current.col++;
    }
    return ch;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:17,代码来源:JspReader.java

示例9: PageDataImpl

import org.apache.jasper.JasperException; //导入依赖的package包/类
/**
    * Constructor.
    *
    * @param page the page nodes from which to generate the XML view
    */
   public PageDataImpl(Node.Nodes page, Compiler compiler)
        throws JasperException {

// First pass
FirstPassVisitor firstPass = new FirstPassVisitor(page.getRoot(),
						  compiler.getPageInfo());
page.visit(firstPass);

// Second pass
buf = new StringBuffer();
SecondPassVisitor secondPass
    = new SecondPassVisitor(page.getRoot(), buf, compiler,
			    firstPass.getJspIdPrefix());
page.visit(secondPass);
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:PageDataImpl.java

示例10: parseSetProperty

import org.apache.jasper.JasperException; //导入依赖的package包/类
private void parseSetProperty(Node parent) throws JasperException {
    Attributes attrs = parseAttributes();
    reader.skipSpaces();

    Node setPropertyNode = new Node.SetProperty(attrs, start, parent);

    parseOptionalBody(setPropertyNode, "jsp:setProperty",
            TagInfo.BODY_CONTENT_EMPTY);
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:10,代码来源:Parser.java

示例11: introspect

import org.apache.jasper.JasperException; //导入依赖的package包/类
public static void introspect(Object bean, ServletRequest request)
                              throws JasperException
{
    Enumeration<String> e = request.getParameterNames();
    while ( e.hasMoreElements() ) {
        String name  = e.nextElement();
        String value = request.getParameter(name);
        introspecthelper(bean, name, value, request, name, true);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:JspRuntimeLibrary.java

示例12: parsePageDirective

import org.apache.jasper.JasperException; //导入依赖的package包/类
private void parsePageDirective(Node parent) throws JasperException {
    Attributes attrs = parseAttributes();
    Node.PageDirective n = new Node.PageDirective(attrs, start, parent);

    /*
     * A page directive may contain multiple 'import' attributes, each of
     * which consists of a comma-separated list of package names. Store each
     * list with the node, where it is parsed.
     */
    for (int i = 0; i < attrs.getLength(); i++) {
        if ("import".equals(attrs.getQName(i))) {
            n.addImport(attrs.getValue(i));
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:Parser.java

示例13: parseForward

import org.apache.jasper.JasperException; //导入依赖的package包/类
private void parseForward(Node parent) throws JasperException {
    Attributes attrs = parseAttributes();
    reader.skipSpaces();

    Node forwardNode = new Node.ForwardAction(attrs, start, parent);

    parseOptionalBody(forwardNode, "jsp:forward", JAVAX_BODY_CONTENT_PARAM);
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:9,代码来源:Parser.java

示例14: introspect

import org.apache.jasper.JasperException; //导入依赖的package包/类
public static void introspect(Object bean, ServletRequest request) throws JasperException {
	Enumeration<String> e = request.getParameterNames();
	while (e.hasMoreElements()) {
		String name = e.nextElement();
		String value = request.getParameter(name);
		introspecthelper(bean, name, value, request, name, true);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:9,代码来源:JspRuntimeLibrary.java

示例15: visit

import org.apache.jasper.JasperException; //导入依赖的package包/类
public void visit(Node.TemplateText n) throws JasperException {
    /*
     * If the template text came from a JSP page written in JSP syntax,
     * create a jsp:text element for it (JSP 5.3.2).
     */
    appendText(n.getText(), !n.getRoot().isXmlSyntax());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:PageDataImpl.java


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