Package org.apache.jasper.runtime
Class JspRuntimeLibrary
- java.lang.Object
- 
- org.apache.jasper.runtime.JspRuntimeLibrary
 
- 
 public class JspRuntimeLibrary extends java.lang.ObjectBunch of util methods that are used by code generated for useBean, getProperty and setProperty. The __begin, __end stuff is there so that the JSP engine can actually parse this file and inline them if people don't want runtime dependencies on this class. However, I'm not sure if that works so well right now. It got forgotten at some point. -akv- Author:
- Mandar Raje, Shawn Bayern
 
- 
- 
Constructor SummaryConstructors Constructor Description JspRuntimeLibrary()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Objectcoerce(java.lang.String s, java.lang.Class<?> target)static booleancoerceToBoolean(java.lang.String s)static bytecoerceToByte(java.lang.String s)static charcoerceToChar(java.lang.String s)static doublecoerceToDouble(java.lang.String s)static floatcoerceToFloat(java.lang.String s)static intcoerceToInt(java.lang.String s)static longcoerceToLong(java.lang.String s)static shortcoerceToShort(java.lang.String s)static java.lang.Objectconvert(java.lang.String propertyName, java.lang.String s, java.lang.Class<?> t, java.lang.Class<?> propertyEditorClass)static voidcreateTypedArray(java.lang.String propertyName, java.lang.Object bean, java.lang.reflect.Method method, java.lang.String[] values, java.lang.Class<?> t, java.lang.Class<?> propertyEditorClass)Create a typed array.static java.lang.StringescapeQueryString(java.lang.String unescString)Escape special shell characters.static java.lang.StringgetContextRelativePath(ServletRequest request, java.lang.String relativePath)Convert a possibly relative resource path into a context-relative resource path that starts with a '/'.static java.lang.reflect.MethodgetReadMethod(java.lang.Class<?> beanClass, java.lang.String prop)static java.lang.ThrowablegetThrowable(ServletRequest request)Returns the value of the javax.servlet.error.exception request attribute value, if present, otherwise the value of the javax.servlet.jsp.jspException request attribute value.static java.lang.ObjectgetValueFromBeanInfoPropertyEditor(java.lang.Class<?> attrClass, java.lang.String attrName, java.lang.String attrValue, java.lang.Class<?> propertyEditorClass)static java.lang.ObjectgetValueFromPropertyEditorManager(java.lang.Class<?> attrClass, java.lang.String attrName, java.lang.String attrValue)static java.lang.reflect.MethodgetWriteMethod(java.lang.Class<?> beanClass, java.lang.String prop)static java.lang.ObjecthandleGetProperty(java.lang.Object o, java.lang.String prop)static voidhandleSetProperty(java.lang.Object bean, java.lang.String prop, boolean value)static voidhandleSetProperty(java.lang.Object bean, java.lang.String prop, byte value)static voidhandleSetProperty(java.lang.Object bean, java.lang.String prop, char value)static voidhandleSetProperty(java.lang.Object bean, java.lang.String prop, double value)static voidhandleSetProperty(java.lang.Object bean, java.lang.String prop, float value)static voidhandleSetProperty(java.lang.Object bean, java.lang.String prop, int value)static voidhandleSetProperty(java.lang.Object bean, java.lang.String prop, long value)static voidhandleSetProperty(java.lang.Object bean, java.lang.String prop, short value)static voidhandleSetProperty(java.lang.Object bean, java.lang.String prop, java.lang.Object value)static voidhandleSetPropertyExpression(java.lang.Object bean, java.lang.String prop, java.lang.String expression, PageContext pageContext, ProtectedFunctionMapper functionMapper)static voidinclude(ServletRequest request, ServletResponse response, java.lang.String relativePath, JspWriter out, boolean flush)Perform a RequestDispatcher.include() operation, with optional flushing of the response beforehand.static voidintrospect(java.lang.Object bean, ServletRequest request)static voidintrospecthelper(java.lang.Object bean, java.lang.String prop, java.lang.String value, ServletRequest request, java.lang.String param, boolean ignoreMethodNF)protected static voidreleaseTag(Tag tag, InstanceManager instanceManager)static voidreleaseTag(Tag tag, InstanceManager instanceManager, boolean reused)static JspWriterstartBufferedBody(PageContext pageContext, BodyTag tag)static java.lang.StringtoString(boolean b)static java.lang.StringtoString(byte b)static java.lang.StringtoString(char c)static java.lang.StringtoString(double d)static java.lang.StringtoString(float f)static java.lang.StringtoString(int i)static java.lang.StringtoString(long l)static java.lang.StringtoString(short s)static java.lang.StringtoString(java.lang.Object o)static java.lang.StringURLEncode(java.lang.String s, java.lang.String enc)URL encodes a string, based on the supplied character encoding.
 
- 
- 
- 
Method Detail- 
getThrowablepublic static java.lang.Throwable getThrowable(ServletRequest request) Returns the value of the javax.servlet.error.exception request attribute value, if present, otherwise the value of the javax.servlet.jsp.jspException request attribute value. This method is called at the beginning of the generated servlet code for a JSP error page, when the "exception" implicit scripting language variable is initialized.- Parameters:
- request- The Servlet request
- Returns:
- the throwable in the error attribute if any
 
 - 
coerceToBooleanpublic static boolean coerceToBoolean(java.lang.String s) 
 - 
coerceToBytepublic static byte coerceToByte(java.lang.String s) 
 - 
coerceToCharpublic static char coerceToChar(java.lang.String s) 
 - 
coerceToDoublepublic static double coerceToDouble(java.lang.String s) 
 - 
coerceToFloatpublic static float coerceToFloat(java.lang.String s) 
 - 
coerceToIntpublic static int coerceToInt(java.lang.String s) 
 - 
coerceToShortpublic static short coerceToShort(java.lang.String s) 
 - 
coerceToLongpublic static long coerceToLong(java.lang.String s) 
 - 
coercepublic static java.lang.Object coerce(java.lang.String s, java.lang.Class<?> target)
 - 
convertpublic static java.lang.Object convert(java.lang.String propertyName, java.lang.String s, java.lang.Class<?> t, java.lang.Class<?> propertyEditorClass) throws JasperException- Throws:
- JasperException
 
 - 
introspectpublic static void introspect(java.lang.Object bean, ServletRequest request) throws JasperException- Throws:
- JasperException
 
 - 
introspecthelperpublic static void introspecthelper(java.lang.Object bean, java.lang.String prop, java.lang.String value, ServletRequest request, java.lang.String param, boolean ignoreMethodNF) throws JasperException- Throws:
- JasperException
 
 - 
toStringpublic static java.lang.String toString(java.lang.Object o) 
 - 
toStringpublic static java.lang.String toString(byte b) 
 - 
toStringpublic static java.lang.String toString(boolean b) 
 - 
toStringpublic static java.lang.String toString(short s) 
 - 
toStringpublic static java.lang.String toString(int i) 
 - 
toStringpublic static java.lang.String toString(float f) 
 - 
toStringpublic static java.lang.String toString(long l) 
 - 
toStringpublic static java.lang.String toString(double d) 
 - 
toStringpublic static java.lang.String toString(char c) 
 - 
createTypedArraypublic static void createTypedArray(java.lang.String propertyName, java.lang.Object bean, java.lang.reflect.Method method, java.lang.String[] values, java.lang.Class<?> t, java.lang.Class<?> propertyEditorClass) throws JasperExceptionCreate a typed array. This is a special case where params are passed through the request and the property is indexed.- Parameters:
- propertyName- The property name
- bean- The bean
- method- The method
- values- Array values
- t- The class
- propertyEditorClass- The editor for the property
- Throws:
- JasperException- An error occurred
 
 - 
escapeQueryStringpublic static java.lang.String escapeQueryString(java.lang.String unescString) Escape special shell characters.- Parameters:
- unescString- The string to shell-escape
- Returns:
- The escaped shell string.
 
 - 
handleGetPropertypublic static java.lang.Object handleGetProperty(java.lang.Object o, java.lang.String prop) throws JasperException- Throws:
- JasperException
 
 - 
handleSetPropertyExpressionpublic static void handleSetPropertyExpression(java.lang.Object bean, java.lang.String prop, java.lang.String expression, PageContext pageContext, ProtectedFunctionMapper functionMapper) throws JasperException- Throws:
- JasperException
 
 - 
handleSetPropertypublic static void handleSetProperty(java.lang.Object bean, java.lang.String prop, java.lang.Object value) throws JasperException- Throws:
- JasperException
 
 - 
handleSetPropertypublic static void handleSetProperty(java.lang.Object bean, java.lang.String prop, int value) throws JasperException- Throws:
- JasperException
 
 - 
handleSetPropertypublic static void handleSetProperty(java.lang.Object bean, java.lang.String prop, short value) throws JasperException- Throws:
- JasperException
 
 - 
handleSetPropertypublic static void handleSetProperty(java.lang.Object bean, java.lang.String prop, long value) throws JasperException- Throws:
- JasperException
 
 - 
handleSetPropertypublic static void handleSetProperty(java.lang.Object bean, java.lang.String prop, double value) throws JasperException- Throws:
- JasperException
 
 - 
handleSetPropertypublic static void handleSetProperty(java.lang.Object bean, java.lang.String prop, float value) throws JasperException- Throws:
- JasperException
 
 - 
handleSetPropertypublic static void handleSetProperty(java.lang.Object bean, java.lang.String prop, char value) throws JasperException- Throws:
- JasperException
 
 - 
handleSetPropertypublic static void handleSetProperty(java.lang.Object bean, java.lang.String prop, byte value) throws JasperException- Throws:
- JasperException
 
 - 
handleSetPropertypublic static void handleSetProperty(java.lang.Object bean, java.lang.String prop, boolean value) throws JasperException- Throws:
- JasperException
 
 - 
getWriteMethodpublic static java.lang.reflect.Method getWriteMethod(java.lang.Class<?> beanClass, java.lang.String prop) throws JasperException- Throws:
- JasperException
 
 - 
getReadMethodpublic static java.lang.reflect.Method getReadMethod(java.lang.Class<?> beanClass, java.lang.String prop) throws JasperException- Throws:
- JasperException
 
 - 
getValueFromBeanInfoPropertyEditorpublic static java.lang.Object getValueFromBeanInfoPropertyEditor(java.lang.Class<?> attrClass, java.lang.String attrName, java.lang.String attrValue, java.lang.Class<?> propertyEditorClass) throws JasperException- Throws:
- JasperException
 
 - 
getValueFromPropertyEditorManagerpublic static java.lang.Object getValueFromPropertyEditorManager(java.lang.Class<?> attrClass, java.lang.String attrName, java.lang.String attrValue) throws JasperException- Throws:
- JasperException
 
 - 
getContextRelativePathpublic static java.lang.String getContextRelativePath(ServletRequest request, java.lang.String relativePath) Convert a possibly relative resource path into a context-relative resource path that starts with a '/'.- Parameters:
- request- The servlet request we are processing
- relativePath- The possibly relative resource path
- Returns:
- an absolute path
 
 - 
includepublic static void include(ServletRequest request, ServletResponse response, java.lang.String relativePath, JspWriter out, boolean flush) throws java.io.IOException, ServletException Perform a RequestDispatcher.include() operation, with optional flushing of the response beforehand.- Parameters:
- request- The servlet request we are processing
- response- The servlet response we are processing
- relativePath- The relative path of the resource to be included
- out- The Writer to whom we are currently writing
- flush- Should we flush before the include is processed?
- Throws:
- java.io.IOException- if thrown by the included servlet
- ServletException- if thrown by the included servlet
 
 - 
URLEncodepublic static java.lang.String URLEncode(java.lang.String s, java.lang.String enc)URL encodes a string, based on the supplied character encoding. This performs the same function as java.next.URLEncode.encode in J2SDK1.4, and should be removed if the only platform supported is 1.4 or higher.- Parameters:
- s- The String to be URL encoded.
- enc- The character encoding
- Returns:
- The URL encoded String
 
 - 
startBufferedBodypublic static JspWriter startBufferedBody(PageContext pageContext, BodyTag tag) throws JspException - Throws:
- JspException
 
 - 
releaseTagpublic static void releaseTag(Tag tag, InstanceManager instanceManager, boolean reused) 
 - 
releaseTagprotected static void releaseTag(Tag tag, InstanceManager instanceManager) 
 
- 
 
-