Package org.apache.jasper.runtime
Class JspRuntimeLibrary
java.lang.Object
org.apache.jasper.runtime.JspRuntimeLibrary
Bunch 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
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Stringcapitalize(String name) Reverse of Introspector.decapitalize.static Objectstatic booleanstatic bytestatic charstatic doublestatic floatstatic intstatic longstatic shortstatic Objectstatic voidcreateTypedArray(String propertyName, Object bean, Method method, String[] values, Class<?> t, Class<?> propertyEditorClass) Create a typed array.static StringescapeQueryString(String unescString) Escape special shell characters.static StringgetContextRelativePath(ServletRequest request, String relativePath) Convert a possibly relative resource path into a context-relative resource path that starts with a '/'.static MethodgetReadMethod(Class<?> beanClass, String prop) static ThrowablegetThrowable(ServletRequest request) Returns the value of the jakarta.servlet.error.exception request attribute value, if present, otherwise the value of the jakarta.servlet.jsp.jspException request attribute value.static ObjectgetValueFromBeanInfoPropertyEditor(Class<?> attrClass, String attrName, String attrValue, Class<?> propertyEditorClass) static ObjectgetValueFromPropertyEditorManager(Class<?> attrClass, String attrName, String attrValue) static MethodgetWriteMethod(Class<?> beanClass, String prop) static ObjecthandleGetProperty(Object o, String prop) static voidhandleSetProperty(Object bean, String prop, boolean value) static voidhandleSetProperty(Object bean, String prop, byte value) static voidhandleSetProperty(Object bean, String prop, char value) static voidhandleSetProperty(Object bean, String prop, double value) static voidhandleSetProperty(Object bean, String prop, float value) static voidhandleSetProperty(Object bean, String prop, int value) static voidhandleSetProperty(Object bean, String prop, long value) static voidhandleSetProperty(Object bean, String prop, short value) static voidhandleSetProperty(Object bean, String prop, Object value) static voidhandleSetPropertyExpression(Object bean, String prop, String expression, PageContext pageContext, ProtectedFunctionMapper functionMapper) static voidinclude(ServletRequest request, ServletResponse response, String relativePath, JspWriter out, boolean flush) Perform a RequestDispatcher.include() operation, with optional flushing of the response beforehand.static voidintrospect(Object bean, ServletRequest request) static voidintrospecthelper(Object bean, String prop, String value, ServletRequest request, 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 StringtoString(boolean b) static StringtoString(byte b) static StringtoString(char c) static StringtoString(double d) static StringtoString(float f) static StringtoString(int i) static StringtoString(long l) static StringtoString(short s) static Stringstatic StringURL encodes a string, based on the supplied character encoding.
- 
Field Details- 
GRAALpublic static final boolean GRAAL
 
- 
- 
Constructor Details- 
JspRuntimeLibrarypublic JspRuntimeLibrary()
 
- 
- 
Method Details- 
getThrowableReturns the value of the jakarta.servlet.error.exception request attribute value, if present, otherwise the value of the jakarta.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
 
- 
coerceToBoolean
- 
coerceToByte
- 
coerceToChar
- 
coerceToDouble
- 
coerceToFloat
- 
coerceToInt
- 
coerceToShort
- 
coerceToLong
- 
coerce
- 
convertpublic static Object convert(String propertyName, String s, Class<?> t, Class<?> propertyEditorClass) throws JasperException - Throws:
- JasperException
 
- 
introspect- Throws:
- JasperException
 
- 
introspecthelperpublic static void introspecthelper(Object bean, String prop, String value, ServletRequest request, String param, boolean ignoreMethodNF) throws JasperException - Throws:
- JasperException
 
- 
toString
- 
toString
- 
toString
- 
toString
- 
toString
- 
toString
- 
toString
- 
toString
- 
toString
- 
createTypedArraypublic static void createTypedArray(String propertyName, Object bean, Method method, String[] values, Class<?> t, Class<?> propertyEditorClass) throws JasperException Create 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
 
- 
escapeQueryStringEscape special shell characters.- Parameters:
- unescString- The string to shell-escape
- Returns:
- The escaped shell string.
 
- 
handleGetProperty- Throws:
- JasperException
 
- 
handleSetPropertyExpressionpublic static void handleSetPropertyExpression(Object bean, String prop, String expression, PageContext pageContext, ProtectedFunctionMapper functionMapper) throws JasperException - Throws:
- JasperException
 
- 
handleSetProperty- Throws:
- JasperException
 
- 
handleSetProperty- Throws:
- JasperException
 
- 
handleSetProperty- Throws:
- JasperException
 
- 
handleSetProperty- Throws:
- JasperException
 
- 
handleSetProperty- Throws:
- JasperException
 
- 
handleSetProperty- Throws:
- JasperException
 
- 
handleSetProperty- Throws:
- JasperException
 
- 
handleSetProperty- Throws:
- JasperException
 
- 
handleSetPropertypublic static void handleSetProperty(Object bean, String prop, boolean value) throws JasperException - Throws:
- JasperException
 
- 
capitalizeReverse of Introspector.decapitalize.- Parameters:
- name- The name
- Returns:
- the capitalized string
 
- 
getWriteMethod- Throws:
- JasperException
 
- 
getReadMethod- Throws:
- JasperException
 
- 
getValueFromBeanInfoPropertyEditorpublic static Object getValueFromBeanInfoPropertyEditor(Class<?> attrClass, String attrName, String attrValue, Class<?> propertyEditorClass) throws JasperException - Throws:
- JasperException
 
- 
getValueFromPropertyEditorManagerpublic static Object getValueFromPropertyEditorManager(Class<?> attrClass, String attrName, String attrValue) throws JasperException - Throws:
- JasperException
 
- 
getContextRelativePathConvert 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, String relativePath, JspWriter out, boolean flush) throws 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:
- IOException- if thrown by the included servlet
- ServletException- if thrown by the included servlet
 
- 
URLEncodeURL 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
 
- 
startBufferedBody- Throws:
- JspException
 
- 
releaseTag
- 
releaseTag
 
-