Loading ...
Sorry, an error occurred while loading the content.

[Cheetahtemplate-discuss] cheetah/webware arg caching

Expand Messages
  • Geoff Howland
    Im having a problem that I believe (though am not sure) is a Cheetah servlet issue. I have a pretty standard layout where I can select different items to edit
    Message 1 of 3 , May 29, 2003
    • 0 Attachment
      Im having a problem that I believe (though am not sure) is a Cheetah servlet
      issue. I have a pretty standard layout where I can select different items
      to edit through a CGI arg, and then update the form that is based on the
      passed in CGI args. So that (actual URLs are not important):

      http://localhost/cgi-bin/wkcgi.exe/iit/rule_edit.py?id=2
      and
      http://localhost/cgi-bin/wkcgi.exe/iit/rule_edit.py?id=3

      Reference different 'id' numbers, and give me different data. Unfortunately
      some caching or something seems to be happening, and after I load up a
      "id=2" page and submit something, if I then try to type in "id=3", it keeps
      giving me the same page I just submitted from the "id=2" form submit.

      It never seems to change, I just keep getting the same results I received
      after submitting the original form. If I never submit a form, I can change
      the "id=" and get different results, as I would expect.

      Checking the Webware log, it sees the request properly:

      17 2003-05-29 13:08:08 /cgi-bin/wkcgi.exe/iit/rule_edit.py?id=2
      17 0.05 secs /cgi-bin/wkcgi.exe/iit/rule_edit.py?id=2

      18 2003-05-29 13:08:10 /cgi-bin/wkcgi.exe/iit/rule_edit.py?id=3
      18 0.06 secs /cgi-bin/wkcgi.exe/iit/rule_edit.py?id=3

      So each request I make should clear out any CGI args being passed through.
      I even shut down my browser and re-paste in the URL, and the same thing
      occurs. Its not a web page cache, because I have also cleared content. If
      I restart the Webware AppServer, the next time I try to change the "id=", it
      works. This backs up that it is not a browser caching issue.

      Ive been doing web programming a long time with PHP and Perl and have a good
      understanding of how CGI data is passed around, and what Im doing by
      manually typing in the URL should not pass any previous CGI args, yet it is
      acting as if I have, and it is ignoring the URL argument I am providing.

      I have no caching set in my Cheetah templates. No settings in Webware seem
      to deal with this, the ContentCaching set to 0 or 1 made no difference.

      I am doing a #extends from a class, if that could matter (though Im not sure
      how, because its very primitive).

      Does anyone have any idea why this is occuring?

      -Geoff





      -------------------------------------------------------
      This SF.net email is sponsored by: eBay
      Get office equipment for less on eBay!
      http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Tavis Rudd
      Hi Geoff, I have a few questions: * is rule_edit.py a compiled verision of rule_edit.tmpl? * how are you accessing the GET vars from the QUERY_STRING? * what
      Message 2 of 3 , May 29, 2003
      • 0 Attachment
        Hi Geoff,
        I have a few questions:
        * is rule_edit.py a compiled verision of rule_edit.tmpl?
        * how are you accessing the GET vars from the QUERY_STRING?
        * what happens when you include a print statement that shows the current value
        of the 'id' GET var for each request?

        Cheers,
        Tavis

        On Thursday 29 May 2003 13:25, Geoff Howland wrote:
        > Im having a problem that I believe (though am not sure) is a Cheetah
        > servlet issue. I have a pretty standard layout where I can select
        > different items to edit through a CGI arg, and then update the form that is
        > based on the passed in CGI args. So that (actual URLs are not important):
        >
        > http://localhost/cgi-bin/wkcgi.exe/iit/rule_edit.py?id=2
        > and
        > http://localhost/cgi-bin/wkcgi.exe/iit/rule_edit.py?id=3
        >
        > Reference different 'id' numbers, and give me different data.
        > Unfortunately some caching or something seems to be happening, and after I
        > load up a "id=2" page and submit something, if I then try to type in
        > "id=3", it keeps giving me the same page I just submitted from the "id=2"
        > form submit.
        >
        > It never seems to change, I just keep getting the same results I received
        > after submitting the original form. If I never submit a form, I can change
        > the "id=" and get different results, as I would expect.
        >
        > Checking the Webware log, it sees the request properly:
        >
        > 17 2003-05-29 13:08:08 /cgi-bin/wkcgi.exe/iit/rule_edit.py?id=2
        > 17 0.05 secs /cgi-bin/wkcgi.exe/iit/rule_edit.py?id=2
        >
        > 18 2003-05-29 13:08:10 /cgi-bin/wkcgi.exe/iit/rule_edit.py?id=3
        > 18 0.06 secs /cgi-bin/wkcgi.exe/iit/rule_edit.py?id=3
        >
        > So each request I make should clear out any CGI args being passed through.
        > I even shut down my browser and re-paste in the URL, and the same thing
        > occurs. Its not a web page cache, because I have also cleared content. If
        > I restart the Webware AppServer, the next time I try to change the "id=",
        > it works. This backs up that it is not a browser caching issue.
        >
        > Ive been doing web programming a long time with PHP and Perl and have a
        > good understanding of how CGI data is passed around, and what Im doing by
        > manually typing in the URL should not pass any previous CGI args, yet it is
        > acting as if I have, and it is ignoring the URL argument I am providing.
        >
        > I have no caching set in my Cheetah templates. No settings in Webware seem
        > to deal with this, the ContentCaching set to 0 or 1 made no difference.
        >
        > I am doing a #extends from a class, if that could matter (though Im not
        > sure how, because its very primitive).
        >
        > Does anyone have any idea why this is occuring?
        >
        > -Geoff
        >
        >
        >
        >
        >
        > -------------------------------------------------------
        > This SF.net email is sponsored by: eBay
        > Get office equipment for less on eBay!
        > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
        > _______________________________________________
        > Cheetahtemplate-discuss mailing list
        > Cheetahtemplate-discuss@...
        > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss



        -------------------------------------------------------
        This SF.net email is sponsored by: eBay
        Get office equipment for less on eBay!
        http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      • Geoff Howland
        ... Hi, thanks for the really fast response! :) ... Yes ... I am doing this: #set $args = {} #for item in $request.fields.keys() #set $args[item] =
        Message 3 of 3 , May 29, 2003
        • 0 Attachment
          > Hi Geoff,

          Hi, thanks for the really fast response! :)

          > I have a few questions:
          > * is rule_edit.py a compiled verision of rule_edit.tmpl?

          Yes

          > * how are you accessing the GET vars from the QUERY_STRING?

          I am doing this:

          #set $args = {}
          #for item in $request.fields.keys()
          #set $args[item] = $forceList($request.field(item, []))
          #end for

          Where forceList() is a function in my class I am extending that makes sure
          all things are returned as a list, even if theyre just 1 element (so I can
          treat them all the same way).

          > * what happens when you include a print statement that shows the current
          value
          > of the 'id' GET var for each request?

          This is strange.

          When I resubmit the page with the new 'id' it is updated properly. Only has
          a single element of 1 ID, however other data is persisting where it should
          not:

          #set $args = {}
          #for item in $request.fields.keys()
          #set $args[item] = $forceList($request.field(item, []))
          #end for

          Args: $args

          #set $argsDictList =
          $dictlist.removeEmptyRows($dictlist.convertFromCGI($args), ('operator',))

          ArgsList: $argsDictList

          __Result__

          Args: {'id': ['1']}

          ArgsList: {'data': [{'field': 'id', 'value': '3'}], 'Rule': [{'field':
          'upload.flag', 'right': {'table': None, 'field': 'id'}, 'datasource':
          'phpBB', 'groupname': 'Entries', 'operator': '=', 'value': 'id', 'left':
          {'table': 'upload', 'field': 'flag'}}, {'field': 'users.user_id', 'right':
          {'table': 'upload', 'field': 'user_id'}, 'depend': [{'field': 'upload.flag',
          'right': {'table': None, 'field': 'id'}, 'datasource': 'phpBB', 'groupname':
          'Entries', 'operator': '=', 'value': 'id', 'left': {'table': 'upload',
          'field': 'flag'}}], 'datasource': 'phpBB', 'groupname': 'Entries',
          'operator': '=', 'value': 'upload.user_id', 'left': {'table': 'users',
          'field': 'user_id'}}]}

          This is very weird, because the functions removeEmptyRows() and
          convertFromCGI() have no persistence at all. They only accept new data,
          which is $args (which only has the single 'id' field). These args were
          valid form CGI data for the initial page, but I have no idea why they
          persist...

          Is there any reason that Cheetah/Webware should cache the return value of
          these functions?

          -Geoff





          -------------------------------------------------------
          This SF.net email is sponsored by: eBay
          Get office equipment for less on eBay!
          http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
          _______________________________________________
          Cheetahtemplate-discuss mailing list
          Cheetahtemplate-discuss@...
          https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
        Your message has been successfully submitted and would be delivered to recipients shortly.