commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-commons/latka/src/java/org/apache/commons/latka/jelly RequestTag.java ValidateTag.java
Date Thu, 10 Oct 2002 19:35:43 GMT
morgand     2002/10/10 12:35:43

  Modified:    latka/src/java/org/apache/commons/latka/jelly
                        RequestTag.java ValidateTag.java
  Log:
  cleaned up request skipping
  
  Revision  Changes    Path
  1.6       +8 -7      jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/RequestTag.java
  
  Index: RequestTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/RequestTag.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RequestTag.java	10 Oct 2002 19:18:36 -0000	1.5
  +++ RequestTag.java	10 Oct 2002 19:35:43 -0000	1.6
  @@ -121,9 +121,10 @@
   
           LatkaEventInfo listener =
               JellyUtils.getInstance().getLatkaEventInfo(getContext());
  -        if (listener.didSessionSucceed(findSession()) == false && 
  -            _requestExecuted == false) {
  -            listener.requestSkipped(new RequestSkippedEvent(createRequest(),null));
  +        if (listener.didSessionSucceed(findSession()) == false) {
  +            if (_requestExecuted == false) {
  +                listener.requestSkipped(new RequestSkippedEvent(createRequest(),null));
  +            }
               return;
           }
   
  @@ -148,7 +149,7 @@
        *                   Error creating the request (unrecoverable, the script
        *                   must fail)
        */
  -    protected Request createRequest() throws LatkaException {
  +    public Request createRequest() throws LatkaException {
           String host = _host;
           int port    = _port;
           String proxyHost = _proxyHost;
  
  
  
  1.3       +13 -3     jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/ValidateTag.java
  
  Index: ValidateTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/ValidateTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ValidateTag.java	8 Oct 2002 19:29:01 -0000	1.2
  +++ ValidateTag.java	10 Oct 2002 19:35:43 -0000	1.3
  @@ -65,6 +65,7 @@
   import org.apache.commons.jelly.XMLOutput;
   
   import org.apache.commons.latka.LatkaException;
  +import org.apache.commons.latka.event.LatkaEventInfo;
   import org.apache.commons.latka.http.Response;
   
   import org.apache.log4j.Category;
  @@ -82,6 +83,15 @@
        * @throws Exception when any error occurs
        */
       public void doTag(XMLOutput xmlOutput) throws Exception {
  +
  +        RequestTag tag = (RequestTag) findAncestorWithClass(RequestTag.class);
  +        LatkaEventInfo info = 
  +            JellyUtils.getInstance().getLatkaEventInfo(getContext());
  +        if (info.didSessionSucceed(tag.findSession()) == false) {
  +            // the session is invalid, so return to the request tag,
  +            // which will issue a RequestSkipped event
  +            return;
  +        }
   
           // execute the request
           Response response = getResponse();
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message