jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From felip...@apache.org
Subject cvs commit: jakarta-taglibs-sandbox/rdc/xml intro.xml rdc.xml
Date Tue, 14 Sep 2004 03:44:35 GMT
felipeal    2004/09/13 20:44:35

  Modified:    rdc      build.xml
               rdc/src/org/apache/taglibs/rdc/core ExpandTag.java
               rdc/xml  intro.xml rdc.xml
  Log:
  using commons-el instead of jasper-runtime
  
  Revision  Changes    Path
  1.3       +10 -10    jakarta-taglibs-sandbox/rdc/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs-sandbox/rdc/build.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build.xml	12 Sep 2004 15:50:26 -0000	1.2
  +++ build.xml	14 Sep 2004 03:44:34 -0000	1.3
  @@ -22,20 +22,20 @@
   <!-- Your main ant build declaration -->
   <project name="rdc" default="main">
     <!-- load custom properties that minimally define:
  -  servlet.jar jsp-api.jar
  -  jasper-runtime.jar
  +  servlet24.jar jsp-api.jar
  +  commons-el.jar (***replaces non-portable jasper-runtime.jar***)
     jstl.jar standard.jar 
     commons-digester.jar commons-beanutils.jar struts.jar
     -->
     <property file="../build.properties"/>
     <property name="classpath"
  -  value="${servlet.jar}:${jsp-api.jar}:${jstl.jar}:${standard.jar}:
  -	${jasper-runtime.jar}:${commons-beanutils.jar}:${struts.jar}" />
  +  value="${servlet24.jar}:${jsp-api.jar}:${jstl.jar}:${standard.jar}:
  +	${commons-el.jar}:${commons-beanutils.jar}:${struts.jar}" />
     <property name="checkRequirements.pre" value="checkRequirements.pre"/>
     <target name="checkRequirements.pre">
       <antcall target="checkRequiredFile">
  -      <param name="file" value="${servlet.jar}"/>
  -      <param name="fail.message" value="I could not find servlet.jar"/>
  +      <param name="file" value="${servlet24.jar}"/>
  +      <param name="fail.message" value="I could not find servlet24.jar"/>
       </antcall>
       <antcall target="checkRequiredFile">
         <param name="file" value="${jsp-api.jar}"/>
  @@ -50,12 +50,12 @@
         <param name="fail.message" value="I could not find jstl.jar"/>
       </antcall>
       <antcall target="checkRequiredFile">
  -      <param name="file" value="${jasper-runtime.jar}"/>
  -      <param name="fail.message" value="I could not find jasper-runtime.jar"/>
  -    </antcall>
  -    <antcall target="checkRequiredFile">
         <param name="file" value="${commons-beanutils.jar}"/>
         <param name="fail.message" value="I could not find commons-beanutils.jar"/>
  +    </antcall>
  +    <antcall target="checkRequiredFile">
  +      <param name="file" value="${commons-el.jar}"/>
  +      <param name="fail.message" value="I could not find commons-el.jar"/>
       </antcall>
       <antcall target="checkRequiredFile">
         <param name="file" value="${commons-digester.jar}"/>
  
  
  
  1.3       +27 -8     jakarta-taglibs-sandbox/rdc/src/org/apache/taglibs/rdc/core/ExpandTag.java
  
  Index: ExpandTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs-sandbox/rdc/src/org/apache/taglibs/rdc/core/ExpandTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExpandTag.java	12 Sep 2004 15:50:31 -0000	1.2
  +++ ExpandTag.java	14 Sep 2004 03:44:35 -0000	1.3
  @@ -21,13 +21,22 @@
   
   import java.io.IOException;
   import java.io.StringWriter;
  +import java.util.regex.Pattern;
   import javax.servlet.jsp.JspWriter;
   import javax.servlet.jsp.PageContext;
   import javax.servlet.jsp.JspException;
   import javax.servlet.jsp.JspTagException;
   import javax.servlet.jsp.tagext.JspFragment;
   import javax.servlet.jsp.tagext.SimpleTagSupport;
  -import org.apache.jasper.runtime.PageContextImpl;
  +import javax.servlet.jsp.el.VariableResolver;
  +import org.apache.commons.el.ExpressionEvaluatorImpl;
  +/* 
  + * Rahul 9/13/04- Jasper runtime makes implementation non portable
  + * org.apache.jasper.runtime.PageContextImpl#evaluate
  + * replaced by 
  + * org.apache.commons.el.ExpressionEvaluatorImpl#evaluate
  + */
  +//import org.apache.jasper.runtime.PageContextImpl;
   
   
   /**
  @@ -37,6 +46,7 @@
    * authoring prompt templates  that refer to run-time values.</p>
    * 
    * @author <a href="mailto:tvraman@almaden.ibm.com">T. V. Raman</a>
  + * @author Rahul
    * @version 1.0
    */
   
  @@ -63,15 +73,24 @@
   		}
   		StringWriter bodyExpansion = new StringWriter();
           body.invoke(bodyExpansion);
  -        String expansion =bodyExpansion.getBuffer().toString();
  +        String expansion = bodyExpansion.getBuffer().toString();
           String expression = expansion.replaceAll("#\\{", "\\$\\{");
  -        PageContext pageContext = (PageContext) getJspContext(  );
  +        PageContext pageContext = (PageContext) getJspContext();
  +        /* 
  +         * Rahul - 9/13/04
  +         * Do not use getJspContext().getExpressionEvaluator() --
  +         * which offers no guarantee whether multiple expressions
  +         * occuring in String "expression" will be evaluated
  +         */
  +        ExpressionEvaluatorImpl exprEvaluator = new ExpressionEvaluatorImpl();
  +        VariableResolver varResolver = getJspContext().getVariableResolver();
           JspWriter out = pageContext.getOut();
           try {
  -            String result = (String)
  -                PageContextImpl.proprietaryEvaluate(expression,
  -                                                    java.lang.String.class,
  -                                                    pageContext, null, false);
  +        	// Rahul - 9/13/04 - EL functions are not supported.
  +        	// Since this is in the body of a <vxml:prompt> element, the 
  +        	// result needs to be a String
  +            String result = (String) exprEvaluator.evaluate(expression, 
  +            	java.lang.String.class, varResolver, null);
               out.write(result);           
           } catch (javax.servlet.jsp.el.ELException e) {
               out.write("<!-- Error evaluating expression: "
  
  
  
  1.3       +2 -2      jakarta-taglibs-sandbox/rdc/xml/intro.xml
  
  Index: intro.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs-sandbox/rdc/xml/intro.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- intro.xml	12 Sep 2004 15:50:32 -0000	1.2
  +++ intro.xml	14 Sep 2004 03:44:35 -0000	1.3
  @@ -108,7 +108,7 @@
   <simplelist>
     <member>jstl.jar and standard.jar ---JSTL 1.0</member>
     <member>jsp-api.jar ---for building custom tags</member>
  -  <member>jasper-runtime.jar  --- for delayed EL evaluation</member>
  +  <member>commons-el.jar  --- for delayed EL evaluation</member>
     <member>struts.jar, commons-digester.jar and commons-beanutils.jar  --- for struts
examples</member>
   </simplelist>
   A majority of the tags implemented by this tag library have been
  @@ -176,7 +176,7 @@
     -->
     <li>
       Download the Reusable Dialog Components (RDC)  Tag Library
  -    <a href="http://jakarta.apache.org/builds/jakarta-taglibs/nightly/projects/{taglib-name}/">
  +    <a href="http://jakarta.apache.org/builds/jakarta-taglibs/nightly/projects/rdc/">
       nightly development build</a>
     </li>
     </ul>
  
  
  
  1.3       +6 -7      jakarta-taglibs-sandbox/rdc/xml/rdc.xml
  
  Index: rdc.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs-sandbox/rdc/xml/rdc.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- rdc.xml	12 Sep 2004 15:50:32 -0000	1.2
  +++ rdc.xml	14 Sep 2004 03:44:35 -0000	1.3
  @@ -104,13 +104,12 @@
       <!-- This element must be straight text and is copied right into
       the "Requirements" section of the HTML doc. -->
       <requirements-info>
  -      this custom tag library requires 
  -      a servlet container
  -      that supports the JavaServer Pages Specification, version 2.0 or higher.  
  -      Plus jstl.jar and standard.jar from the Apache project.
  -+ jasper-runtime.jar from Tomcat 5 or equivalent.
  -+ struts.jar, commons-beanutils.jar and commons-digester.jar (for
  -building the struts support).
  +      This custom tag library requires a servlet container
  +      that supports the JavaServer Pages Specification, version 2.0 or higher  
  +      + jstl.jar and standard.jar from the Apache project 
  +	+ commons-el.jar for delayed EL evaluation 
  +	+ struts.jar, commons-beanutils.jar and commons-digester.jar (for
  +	building the struts support).
       </requirements-info>
       
       <!-- The toc element allows the addition of document sections to
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message