本文整理汇总了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);
}
示例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();
}
示例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", "<" + tag);
}
} else {
err.jspError(reader.mark(), "jsp.error.jspbody.emptybody.only",
"<" + tag);
}
} else {
err.jspError(reader.mark(), "jsp.error.unterminated", "<" + tag);
}
}
示例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()));
}
}
示例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);
}
}
}
示例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", "<" + tag);
}
if (reader.matchesETag(tag)) {
// EmptyBody
return;
}
if (!parseJspAttributeAndBody(parent, tag, bodyType)) {
// Must be ( '>' # Body ETag )
parseBody(parent, tag, bodyType);
}
}
示例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()));
}
}
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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));
}
}
}
示例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);
}
示例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);
}
}
示例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());
}