本文整理汇总了Java中org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod方法的典型用法代码示例。如果您正苦于以下问题:Java JspRuntimeLibrary.getReadMethod方法的具体用法?Java JspRuntimeLibrary.getReadMethod怎么用?Java JspRuntimeLibrary.getReadMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jasper.runtime.JspRuntimeLibrary
的用法示例。
在下文中一共展示了JspRuntimeLibrary.getReadMethod方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.apache.jasper.runtime.JspRuntimeLibrary; //导入方法依赖的package包/类
public void visit(Node.GetProperty n) throws JasperException {
String name = n.getTextAttribute("name");
String property = n.getTextAttribute("property");
n.setBeginJavaLine(out.getJavaLine());
if (beanInfo.checkVariable(name)) {
// Bean is defined using useBean, introspect at compile time
Class bean = beanInfo.getBeanType(name);
String beanName = JspUtil.getCanonicalName(bean);
java.lang.reflect.Method meth = JspRuntimeLibrary
.getReadMethod(bean, property);
String methodName = meth.getName();
out
.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString("
+ "((("
+ beanName
+ ")_jspx_page_context.findAttribute("
+ "\""
+ name + "\"))." + methodName + "())));");
} else {
// The object could be a custom action with an associated
// VariableInfo entry for this name.
// Get the class name and then introspect at runtime.
out
.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString"
+ "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty"
+ "(_jspx_page_context.getAttribute(\""
+ name
+ "\", PageContext.PAGE_SCOPE), \""
+ property
+ "\")));");
}
n.setEndJavaLine(out.getJavaLine());
}
示例2: visit
import org.apache.jasper.runtime.JspRuntimeLibrary; //导入方法依赖的package包/类
@Override
public void visit(Node.GetProperty n) throws JasperException {
String name = n.getTextAttribute("name");
String property = n.getTextAttribute("property");
n.setBeginJavaLine(out.getJavaLine());
if (beanInfo.checkVariable(name)) {
// Bean is defined using useBean, introspect at compile time
Class<?> bean = beanInfo.getBeanType(name);
String beanName = bean.getCanonicalName();
java.lang.reflect.Method meth = JspRuntimeLibrary.getReadMethod(bean, property);
String methodName = meth.getName();
out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString(" + "(((" + beanName
+ ")_jspx_page_context.findAttribute(" + "\"" + name + "\"))." + methodName + "())));");
} else if (!STRICT_GET_PROPERTY || varInfoNames.contains(name)) {
// The object is a custom action with an associated
// VariableInfo entry for this name.
// Get the class name and then introspect at runtime.
out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString"
+ "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty"
+ "(_jspx_page_context.findAttribute(\"" + name + "\"), \"" + property + "\")));");
} else {
StringBuilder msg = new StringBuilder();
msg.append("file:");
msg.append(n.getStart());
msg.append(" jsp:getProperty for bean with name '");
msg.append(name);
msg.append("'. Name was not previously introduced as per JSP.5.3");
throw new JasperException(msg.toString());
}
n.setEndJavaLine(out.getJavaLine());
}
示例3: visit
import org.apache.jasper.runtime.JspRuntimeLibrary; //导入方法依赖的package包/类
public void visit(Node.GetProperty n) throws JasperException {
String name = n.getTextAttribute("name");
String property = n.getTextAttribute("property");
n.setBeginJavaLine(out.getJavaLine());
if (beanInfo.checkVariable(name)) {
// Bean is defined using useBean, introspect at compile time
Class bean = beanInfo.getBeanType(name);
String beanName = JspUtil.getCanonicalName(bean);
java.lang.reflect.Method meth =
JspRuntimeLibrary.getReadMethod(bean, property);
String methodName = meth.getName();
out.printil(
"out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString("
+ "((("
+ beanName
+ ")_jspx_page_context.findAttribute("
+ "\""
+ name
+ "\"))."
+ methodName
+ "())));");
} else {
// The object could be a custom action with an associated
// VariableInfo entry for this name.
// Get the class name and then introspect at runtime.
out.printil(
"out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString"
+ "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty"
+ "(_jspx_page_context.findAttribute(\""
+ name
+ "\"), \""
+ property
+ "\")));");
}
n.setEndJavaLine(out.getJavaLine());
}
示例4: visit
import org.apache.jasper.runtime.JspRuntimeLibrary; //导入方法依赖的package包/类
@Override
public void visit(Node.GetProperty n) throws JasperException {
String name = n.getTextAttribute("name");
String property = n.getTextAttribute("property");
n.setBeginJavaLine(out.getJavaLine());
if (beanInfo.checkVariable(name)) {
// Bean is defined using useBean, introspect at compile time
Class<?> bean = beanInfo.getBeanType(name);
String beanName = bean.getCanonicalName();
java.lang.reflect.Method meth = JspRuntimeLibrary
.getReadMethod(bean, property);
String methodName = meth.getName();
out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString("
+ "((("
+ beanName
+ ")_jspx_page_context.findAttribute("
+ "\""
+ name + "\"))." + methodName + "())));");
} else if (!STRICT_GET_PROPERTY || varInfoNames.contains(name)) {
// The object is a custom action with an associated
// VariableInfo entry for this name.
// Get the class name and then introspect at runtime.
out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString"
+ "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty"
+ "(_jspx_page_context.findAttribute(\""
+ name
+ "\"), \""
+ property
+ "\")));");
} else {
StringBuilder msg = new StringBuilder();
msg.append("file:");
msg.append(n.getStart());
msg.append(" jsp:getProperty for bean with name '");
msg.append(name);
msg.append(
"'. Name was not previously introduced as per JSP.5.3");
throw new JasperException(msg.toString());
}
n.setEndJavaLine(out.getJavaLine());
}
示例5: visit
import org.apache.jasper.runtime.JspRuntimeLibrary; //导入方法依赖的package包/类
@Override
public void visit(Node.GetProperty n) throws JasperException {
String name = n.getTextAttribute("name");
String property = n.getTextAttribute("property");
n.setBeginJavaLine(out.getJavaLine());
if (beanInfo.checkVariable(name)) {
// Bean is defined using useBean, introspect at compile time
Class<?> bean = beanInfo.getBeanType(name);
String beanName = bean.getCanonicalName();
java.lang.reflect.Method meth = JspRuntimeLibrary
.getReadMethod(bean, property);
String methodName = meth.getName();
out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString("
+ "((("
+ beanName
+ ")_jspx_page_context.findAttribute("
+ "\""
+ name + "\"))." + methodName + "())));");
} else if (!STRICT_GET_PROPERTY || varInfoNames.contains(name)) {
// The object is a custom action with an associated
// VariableInfo entry for this name.
// Get the class name and then introspect at runtime.
out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString"
+ "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty"
+ "(_jspx_page_context.findAttribute(\""
+ name
+ "\"), \""
+ property
+ "\")));");
} else {
StringBuilder msg = new StringBuilder();
msg.append("file:");
msg.append(n.getStart());
msg.append(" jsp:getProperty for bean with name '");
msg.append(name);
msg.append(
"'. Name was not previously introduced as per JSP.5.3");
throw new JasperException(msg.toString());
}
n.setEndJavaLine(out.getJavaLine());
}