From: Tim L. <tjl...@mb...> - 2002-09-20 20:16:30
|
>>>>> "GT" == Geoffrey Talvola <gta...@na...> writes: GT> You can modify the request object however you please before GT> calling forward(). Just do: GT> self.request().setField('newkey', 'newvalue') GT> And that key/value pair will be available to the servlet you GT> forward to. GT> You might also be able to just directly set attributes of the GT> Request object: GT> self.request().newattribute = 'newvalue' GT> But I haven't tested that. Excellent! That's exactly the sort of thing I was looking for. >> Also Cheetah-related, but what is the best way to have other >> servlets available for forwarding, but not directly callable by >> an end-user? This is essentially just the pretty display code >> for a set of pages, but I don't want anyone able to call up >> templates which haven't been called by the Webware servlet. GT> Hmmm. That's a good question. I can only think of 2 ways, GT> neither one very appealing: GT> 1) Add a special "forwarded" attribute to the request object GT> before forwarding, and test for the presence of that attribute GT> in the request in all of the "hidden" servlets and if you GT> don't find the attribute, send back an error page. GT> 2) Use Apache directives to hide the hidden servlets. I'm GT> sure there's a way to do that. I thought of #1, and I guess it is OK to fall back on, though it didn't really strike me as elegant. Number 2 might also work, as long as there is something in the name you could filter on. The Cheetah templates get converted to Python files though, so the file names aren't an obvious clue. The template servlets could go in a seperate path that Apache rejects I suppose. It isn't really critical at the moment, but when making something, I also tend to think about how it might get broken. <grin> Thanks! Tim |