You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2003/12/28 23:03:28 UTC

cvs commit: jakarta-struts/contrib/struts-faces/src/java/org/apache/struts/faces/application FacesRequestProcessor.java

craigmcc    2003/12/28 14:03:28

  Modified:    contrib/struts-faces build.properties.sample build.xml
               contrib/struts-faces/src/java/org/apache/struts/faces/application
                        FacesRequestProcessor.java
  Log:
  Tweak the build scripts and sample properties for refined prerequisites.
  
  Remove now-obsolete code from the FacesRequestProcessor class, in prep for
  refining how the Faces environment gets itself initialized.
  
  Revision  Changes    Path
  1.4       +14 -16    jakarta-struts/contrib/struts-faces/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/contrib/struts-faces/build.properties.sample,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.properties.sample	24 Dec 2003 03:21:01 -0000	1.3
  +++ build.properties.sample	28 Dec 2003 22:03:27 -0000	1.4
  @@ -13,8 +13,8 @@
   
   # Uncomment the following property setting to build web applications that will
   # include all of the required libraries, and therefore run on containers other
  -# than the Java Web Services Developer Pack (JWSDP) 1.2 Release, which makes
  -# many of these libraries available to web applications already
  +# than the Java Web Services Developer Pack (JWSDP) 1.2 or later, which makes
  +# many of these libraries available to web applications already.
   
   # build.standalone=true
   
  @@ -22,13 +22,17 @@
   # ---------------------- DEPENDENCY HOME DIRECTORIES --------------------------
   
   # The absolute or relative pathname of the Java Web Services Developer Pack
  -# (JWSDP) Version 1.2 installation directory
  +# (JWSDP) Version 1.2 or later installation directory
   jwsdp.home=/usr/local/jwsdp-1.2
   
   # The absolute or relative pathname of the JavaServer Faces Beta Distribution
   # Directory
   jsf.home=/usr/local/jsf-1_0
   
  +# The absolute or relative pathname of the JSP Standard Tag Library 1.0 or later
  +# distribution directory
  +jstl.home=${jwsdp.home}/jstl
  +
   # The absolute or relative pathname of the Struts 1.1 (or later)
   # Distribution Directory
   struts.home=/usr/local/jakarta-struts-1.1
  @@ -37,16 +41,13 @@
   # ---------------------- DEPENDENCY LIBRARY PATHS -----------------------------
   
   # The absolute or relative pathname of the Commons Beanutils Library
  -commons-beanutils.jar=${jwsdp.home}/jwsdp-shared/lib/commons-beanutils.jar
  +commons-beanutils.jar=${struts.home}/lib/commons-beanutils.jar
   
   # The absolute or relative pathname of the Commons Collections Library
  -commons-collections.jar=${jwsdp.home}/jwsdp-shared/lib/commons-collections.jar
  -
  -# The absolute or relative pathname of the Commons DBCP Library
  -commons-dbcp.jar=${jwsdp.home}/common/lib/commons-dbcp.jar
  +commons-collections.jar=${struts.home}/lib/commons-collections.jar
   
   # The absolute or relative pathname of the Commons Digester Library
  -commons-digester.jar=${jwsdp.home}/jwsdp-shared/lib/commons-digester.jar
  +commons-digester.jar=${struts.home}/lib/commons-digester.jar
   
   # The absolute or relative pathname of the Commons FileUpload Library
   commons-fileupload.jar=${struts.home}/lib/commons-fileupload.jar
  @@ -55,10 +56,7 @@
   commons-lang.jar=${struts.home}/lib/commons-lang.jar
   
   # The absolute or relative pathname of the Commons Logging Library
  -commons-logging.jar=${jwsdp.home}/jwsdp-shared/lib/commons-logging.jar
  -
  -# The absolute or relative pathname of the Commons Pool Library
  -commons-pool.jar=${jwsdp.home}/common/lib/commons-pool.jar
  +commons-logging.jar=${struts.home}/lib/commons-logging.jar
   
   # The absolute or relative pathname of the Commons Validator Library
   commons-validator.jar=${struts.home}/lib/commons-validator.jar
  @@ -76,7 +74,7 @@
   
   # The absolute or relative pathname of the JSP Standard Tag Library
   # (JSTL) API Classes
  -jstl.jar=${jsf-impl.home}/lib/jstl.jar
  +jstl.jar=${jstl.home}/lib/jstl.jar
   
   # The absolute or relative pathname of the Servlet 2.4 API Classes
   # (or a combined Servlet 2.3 / JSP 1.2 API classes JAR file)
  @@ -84,7 +82,7 @@
   
   # The absolute or relative pathname of the JSP Standard Tag Library
   # (JSTL) RI Classes
  -standard.jar=${jsf-impl.home}/lib/standard.jar
  +standard.jar=${jstl.home}/lib/standard.jar
   
   # The absolute or relative pathname of the Struts Runtime Library
   struts.jar=${struts.home}/lib/struts.jar
  
  
  
  1.7       +13 -22    jakarta-struts/contrib/struts-faces/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/contrib/struts-faces/build.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- build.xml	24 Dec 2003 03:21:01 -0000	1.6
  +++ build.xml	28 Dec 2003 22:03:27 -0000	1.7
  @@ -13,35 +13,32 @@
   
     <!-- Dependency home directory defaults -->
     <property name="jwsdp.home"       value="/usr/local/jwsdp-1.2"/>
  -  <property name="jsf-impl.home"    value="${jwsdp.home}/jsf"/>
  -  <property name="struts.home"      value="../../dist"/>
  +  <property name="jsf.home"         value="/usr/local/jsf-1_0"/>
  +  <property name="jstl.home"        value="${jwsdp.home}/jstl"/>
  +  <property name="struts.home"      value="/usr/local/jakarta-struts-1.1"/>
   
   
     <!-- Dependency library defaults -->
     <property name="commons-beanutils.jar"
  -                                    value="${jwsdp.home}/jwsdp-shared/lib/commons-beanutils.jar"/>
  +                                    value="${struts.home}/lib/commons-beanutils.jar"/>
     <property name="commons-collections.jar"
  -                                    value="${jwsdp.home}/jwsdp-shared/lib/commons-collections.jar"/>
  -  <property name="commons-dbcp.jar"
  -                                    value="${jwsdp.home}/common/lib/commons-dbcp.jar"/>
  +                                    value="${struts.home}/lib/commons-collections.jar"/>
     <property name="commons-digester.jar"
  -                                    value="${jwsdp.home}/jwsdp-shared/lib/commons-digester.jar"/>
  +                                    value="${struts.home}/lib/commons-digester.jar"/>
     <property name="commons-fileupload.jar"
                                       value="${struts.home}/lib/commons-fileupload.jar"/>
     <property name="commons-lang.jar"
                                       value="${struts.home}/lib/commons-lang.jar"/>
     <property name="commons-logging.jar"
  -                                    value="${jwsdp.home}/jwsdp-shared/lib/commons-logging.jar"/>
  -  <property name="commons-pool.jar"
  -                                    value="${jwsdp.home}/common/lib/commons-pool.jar"/>
  +                                    value="${jwsdp.home}/lib/commons-logging.jar"/>
     <property name="commons-validator.jar"
                                       value="${struts.home}/lib/commons-validator.jar"/>
  -  <property name="jsf-api.jar"      value="${jsf-impl.home}/lib/jsf-api.jar"/>
  -  <property name="jsf-impl.jar"       value="${jsf-impl.home}/lib/jsf-impl.jar"/>
  -  <property name="jsp.jar"          value="${jwsdp.home}/common/lib/jsp-api.jar"/>
  -  <property name="jstl.jar"         value="${jsf-impl.home}/lib/jstl.jar"/>
  +  <property name="jsf-api.jar"      value="${jsf.home}/lib/jsf-api.jar"/>
  +  <property name="jsf-impl.jar"     value="${jsf.home}/lib/jsf-impl.jar"/>
  +  <property name="jsp-api.jar"      value="${jwsdp.home}/common/lib/jsp-api.jar"/>
  +  <property name="jstl.jar"         value="${jstl.home}/lib/jstl.jar"/>
     <property name="servlet.jar"      value="${jwsdp.home}/common/lib/servlet-api.jar"/>
  -  <property name="standard.jar"     value="${jsf-impl.home}/lib/standard.jar"/>
  +  <property name="standard.jar"     value="${jstl.home}/lib/standard.jar"/>
     <property name="struts.jar"       value="${struts.home}/lib/struts.jar"/>
   
   
  @@ -63,13 +60,11 @@
     <path id="classpath">
       <pathelement location="${commons-beanutils.jar}"/>
       <pathelement location="${commons-collections.jar}"/>
  -    <pathelement location="${commons-dbcp.jar}"/>
       <pathelement location="${commons-digester.jar}"/>
       <pathelement location="${commons-logging.jar}"/>
  -    <pathelement location="${commons-pool.jar}"/>
       <pathelement location="${commons-validator.jar}"/>
       <pathelement location="${jsf-api.jar}"/>
  -    <pathelement location="${jsp.jar}"/>
  +    <pathelement location="${jsp-api.jar}"/>
       <pathelement location="${jstl.jar}"/>
       <pathelement location="${servlet.jar}"/>
       <pathelement location="${struts.jar}"/>
  @@ -272,10 +267,6 @@
               if="build.standalone">
   
       <!-- Copy libraries required for standalone use only -->
  -    <copy        todir="${build.home}/webapps/example/WEB-INF/lib"
  -                  file="${commons-dbcp.jar}"/>
  -    <copy        todir="${build.home}/webapps/example/WEB-INF/lib"
  -                  file="${commons-pool.jar}"/>
       <copy        todir="${build.home}/webapps/example/WEB-INF/lib"
                     file="${jsf-api.jar}"/>
       <copy        todir="${build.home}/webapps/example/WEB-INF/lib"
  
  
  
  1.5       +8 -118    jakarta-struts/contrib/struts-faces/src/java/org/apache/struts/faces/application/FacesRequestProcessor.java
  
  Index: FacesRequestProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/contrib/struts-faces/src/java/org/apache/struts/faces/application/FacesRequestProcessor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FacesRequestProcessor.java	24 Dec 2003 03:21:01 -0000	1.4
  +++ FacesRequestProcessor.java	28 Dec 2003 22:03:27 -0000	1.5
  @@ -115,91 +115,6 @@
   
   
       /**
  -     * <p>Do a forward to specified uri using request dispatcher.
  -     * This method is used by all internal method needing to transfer
  -     * control to a new resource to create the response.  For a Faces
  -     * request, select the new response component tree in addition to
  -     * the standard processing.</p>
  -     *
  -     * @param uri Uri or Definition name to forward
  -     * @param request Current page request
  -     * @param response Current page response
  -     */
  -    protected void doForward(String uri, HttpServletRequest request,
  -                             HttpServletResponse response)
  -        throws IOException, ServletException
  -    {
  -
  -        if (log.isTraceEnabled()) {
  -            log.trace("Forwarding to URI '" + uri + "'");
  -        }
  -
  -        // On a Faces request, select the new view
  -        FacesContext context = FacesContext.getCurrentInstance();
  -        /*
  -        if ((context != null) && !uri.startsWith("/faces/")) {
  -            selectView(context, uri);
  -        } else {
  -        */
  -            if (response.isCommitted()) {
  -                doInclude(uri, request, response);
  -            } else {
  -                super.doForward(uri, request, response);
  -            }
  -            /*
  -            if (context != null) {
  -                context.responseComplete();
  -            }
  -            */
  -        /*
  -        }
  -        */
  -
  -    }
  -
  -
  -    /**
  -     * <p>Do a include to specified uri using request dispatcher.
  -     * This method is used by all internal method needing to transfer
  -     * control to a new resource to create the response.  For a Faces
  -     * request, select the new response component tree in addition to
  -     * the standard processing.</p>
  -     *
  -     * @param uri Uri or Definition name to forward
  -     * @param request Current page request
  -     * @param response Current page response
  -     */
  -    protected void doInclude(String uri, HttpServletRequest request,
  -                             HttpServletResponse response)
  -        throws IOException, ServletException
  -    {
  -
  -        if (log.isTraceEnabled()) {
  -            log.trace("Including to URI '" + uri + "'");
  -        }
  -
  -        // On a Faces request, select the new view
  -        FacesContext context = FacesContext.getCurrentInstance();
  -        /*
  -        if ((context != null)  && !uri.startsWith("/faces/")) {
  -            ; // FIXME - JSF spec is probably broken w.r.t includes!
  -            selectView(context, uri);
  -        } else {
  -        */
  -            super.doInclude(uri, request, response);
  -            /*
  -            if (context != null) {
  -                context.responseComplete();
  -            }
  -            */
  -        /*
  -        }
  -        */
  -
  -    }
  -
  -
  -    /**
        * <p>Identify and return the path component (from the request URI for a
        * non-Faces request, or from the form event for a Faces request)
        * that we will use to select an ActionMapping to dispatch with.
  @@ -215,9 +130,11 @@
                                    HttpServletResponse response)
           throws IOException {
   
  -        // Handle non-Faces requests in the usual way
  +        // Are we processing a Faces request?
           ActionEvent event = (ActionEvent)
               request.getAttribute(Constants.ACTION_EVENT_KEY);
  +
  +        // Handle non-Faces requests in the usual way
           if (event == null) {
               if (log.isTraceEnabled()) {
                   log.trace("Performing standard processPath() processing");
  @@ -234,7 +151,7 @@
           while (!(component instanceof FormComponent)) {
               component = component.getParent();
               if (component == null) {
  -                log.warn("command component was not nested in a Struts form!");
  +                log.warn("Command component was not nested in a Struts form!");
                   return (null);
               }
           }
  @@ -295,33 +212,6 @@
                   }
                   request.setAttribute(Globals.CANCEL_KEY, Boolean.TRUE);
               }
  -        }
  -
  -    }
  -
  -
  -    // --------------------------------------------------------- Private Methods
  -
  -
  -    /**
  -     * <p>Select the response view that corresponds to the specified
  -     * URI, which is being forwarded to or included.</p>
  -     *
  -     * @param context FacesContext for the request we are processing
  -     * @param uri Context-relative URI of the new resource
  -     */
  -    private void selectView(FacesContext context, String uri) {
  -
  -        if (log.isTraceEnabled()) {
  -            log.trace("Selecting view '" + uri + "'");
  -        }
  -
  -        // Look up the view that corresponds to this URI
  -        try {
  -            ViewHandler vh = context.getApplication().getViewHandler();
  -            UIViewRoot view = vh.createView(context, uri);
  -        } catch (FacesException e) {
  -            log.error("selectView(" + uri + ")", e);
           }
   
       }
  
  
  

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