luehe       2003/01/07 12:47:27

  Modified:    jasper2/src/share/org/apache/jasper/runtime
                        JspRuntimeLibrary.java
  Log:
  Undid change that leveraged org.apache.jasper.compiler.ErrorDispatcher,
  since this change would have required duplication of a lot of the class files
  of jasper-compiler.jar in jasper-runtime.jar
  
  Revision  Changes    Path
  1.14      +38 -31    
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java
  
  Index: JspRuntimeLibrary.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- JspRuntimeLibrary.java    6 Jan 2003 18:57:15 -0000       1.13
  +++ JspRuntimeLibrary.java    7 Jan 2003 20:47:27 -0000       1.14
  @@ -80,8 +80,8 @@
   import javax.servlet.jsp.JspWriter;
   import javax.servlet.jsp.tagext.BodyContent;
   
  +import org.apache.jasper.Constants;
   import org.apache.jasper.JasperException;
  -import org.apache.jasper.compiler.ErrorDispatcher;
   
   // for JSTL expression interpreter
   import javax.servlet.jsp.PageContext;
  @@ -100,12 +100,6 @@
    */
   public class JspRuntimeLibrary {
   
  -    private static ErrorDispatcher err;
  -
  -    static {
  -     err = new ErrorDispatcher();
  -    }
  -
       protected static class PrivilegedIntrospectHelper
        implements PrivilegedExceptionAction {
   
  @@ -288,7 +282,7 @@
                                               t, propertyName, s);
               }
           } catch (Exception ex) {
  -            throw new JasperException (ex);
  +            throw new JasperException(ex);
           }
       }
       // __end convertMethod
  @@ -354,7 +348,9 @@
            if ( method != null ) {
                if (type.isArray()) {
                       if (request == null) {
  -                        err.jspError("jsp.error.beans.setproperty.noindexset");
  +                     throw new JasperException(Constants.getString(
  +                                "jsp.error.beans.setproperty.noindexset",
  +                             new Object[] {}));
                       }
                    Class t = type.getComponentType();
                    String[] values = request.getParameterValues(param);
  @@ -375,15 +371,18 @@
                }
            }
        } catch (Exception ex) {
  -         throw new JasperException (ex);
  +         throw new JasperException(ex);
        }
           if (!ignoreMethodNF && (method == null)) {
               if (type == null) {
  -                err.jspError("jsp.error.beans.noproperty",
  -                          prop, bean.getClass().getName());
  +             throw new JasperException(Constants.getString(
  +                        "jsp.error.beans.noproperty",
  +                     new Object[] { prop, bean.getClass().getName() }));
               } else {
  -             err.jspError("jsp.error.beans.nomethod.setproperty",
  -                          prop, type.getName(), bean.getClass().getName());
  +             throw new JasperException(Constants.getString(
  +                        "jsp.error.beans.nomethod.setproperty",
  +                     new Object[] { prop, type.getName(),
  +                                    bean.getClass().getName() }));
               }
           }
       }
  @@ -611,8 +610,9 @@
       // __begin lookupReadMethodMethod
       public static Object handleGetProperty(Object o, String prop)
       throws JasperException {
  -        if (o == null)        {
  -            err.jspError("jsp.error.beans.nullbean");
  +        if (o == null) {
  +         throw new JasperException(Constants.getString(
  +                 "jsp.error.beans.nullbean", new Object[] {}));
           }
        Object value = null;
           try {
  @@ -794,19 +794,23 @@
                }
               } else {        
                   // just in case introspection silently fails.
  -                err.jspError("jsp.error.beans.nobeaninfo",
  -                          beanClass.getName());
  +                throw new JasperException(Constants.getString(
  +                     "jsp.error.beans.nobeaninfo",
  +                     new Object[] { beanClass.getName() }));
               }
           } catch (Exception ex) {
               throw new JasperException (ex);
           }
           if (method == null) {
               if (type == null) {
  -                err.jspError("jsp.error.beans.noproperty",
  -                          prop, beanClass.getName());
  +             throw new JasperException(Constants.getString(
  +                        "jsp.error.beans.noproperty",
  +                     new Object[] { prop, beanClass.getName() }));
               } else {
  -                err.jspError("jsp.error.beans.nomethod.setproperty",
  -                          prop, type.getName(), beanClass.getName());
  +             throw new JasperException(Constants.getString(
  +                        "jsp.error.beans.nomethod.setproperty",
  +                     new Object[] { prop, type.getName(),
  +                                    beanClass.getName() }));
               }
           }
           return method;
  @@ -832,19 +836,22 @@
                   }
               } else {        
                   // just in case introspection silently fails.
  -                err.jspError("jsp.error.beans.nobeaninfo",
  -                          beanClass.getName());
  +             throw new JasperException(Constants.getString(
  +                        "jsp.error.beans.nobeaninfo",
  +                     new Object[] { beanClass.getName() }));
            }
        } catch (Exception ex) {
            throw new JasperException (ex);
        }
           if (method == null) {
               if (type == null) {
  -                err.jspError("jsp.error.beans.noproperty",
  -                          prop, beanClass.getName());
  +             throw new JasperException(Constants.getString(
  +                        "jsp.error.beans.noproperty",
  +                     new Object[] { prop, beanClass.getName() }));
               } else {
  -                err.jspError("jsp.error.beans.nomethod",
  -                          prop, beanClass.getName());
  +             throw new JasperException(Constants.getString(
  +                        "jsp.error.beans.nomethod",
  +                     new Object[] { prop, beanClass.getName() }));
               }
           }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to