Re: [Pas-dev] include files]
Status: Beta
Brought to you by:
mortis
From: Mental <Me...@Ne...> - 2002-02-28 15:17:25
|
On Thu, Feb 28, 2002 at 09:57:16AM -0500, Kyle R . Burton wrote: > At this point, the compiler could probably use a re-write (the code isn't > the prettiest). Perhaps we should back down on the policy of few to no > external dependencies and base the compiler on HTML::Parser? I'm sure > it would end up being a whole lot cleaner and more extensible. In fact > using HTML::Parser would probably allow us to start the process of moving > towards JSP style taglibs. > At this point I'm actually doing stuff. So I plan on patching up the compiler first. We can do the rewrite as a phase 2. Actually, we could start the rewrite now as I've forked off my own version of pas for my use. Still, I dont think it'd take me long to fix up includes stuff so I might as well do it as an interim fix. > Some other things I've noticed working with Pas lately are that $self->prev() > doesn't seem to be working correctly. Since it's not part of the servlet > model, maybe we just get rid of it? > Just because it isnt part of the servlet model doesnt mean its not a good idea. The servlet model has its own shortcomings. I just got done helping Kevin sort out some stuff that I feel was a shortcoming of the whole servlet thing. I'd go into it, but its long, I forget most of the details and I'm busy. :) > Passing data to the psp from a Page object in the query object is starting > to feel wrong. The issue that caused this to itch for me was on a diagnostics > page where I was trying to dump all of the parameters from the query. I > had a page object that added data to the query, then forwarded the request > to the psp diagnostic page. In the psp page, it had code like this: > > <TABLE> > <TR><TD>key</TD><TD>value</TD></TR> > <% foreach my $k ($self->query()->param()) { %> > <TR><TD><%= $k %></TD><TD><%= $self->query()->param($k) %></TD></TR> > <% } %> > </TABLE> > Wouldnt the stuff you wanted to see be in $self->prev()? Shouldnt it be? Am I not getting it? > But the added data didn't show up in the key names returend from > $self->query()->param(). CGI.pm must be caching the originaly parsed > list of parameters - anything that get's added through a call to param(k,v) > isn't included in the list returned by param(). > > Perhaps we can use the reuqest object directly? Ala the servlet model? > They have a getParameter() that gives access to the GET/POST parameters, > and a getAttribute()/setAttribute() that is a storage area where the > servlet/jsp (page object/psp in our case) are supposed to use to pass > data back and forth. > In my mind it might be a good idea to keep our stuff in its own sandbox. That way we cna differentiate between stuff we inserted and stuff that the browser passed. I'm not sur ethe best way to do this, but it could be something like $self->query() is for cgi.pm stuff (the browser post/get crud). Something ike $self->pasdata() could be used for stuff te application generates and uses internally. There would be no way for the browser to get its evil into it and could therfore be more trusted to contain 'good' data. Segregate user input from application generated stuff. Or maybe I should stop huffing paint. > The last big itch is in the forward_request() method of the page object. It > doesn't seem to work with relativly pathed requests correctly. I've had > to tweak the path to the psp page to get it to work under all circumstances. > Oh, and one last thing is PATH_INFO for registered page objects. It would > be nice of the Pas mod_perl request handler could figure out that a path > lead past a registered page object, and set the PATH_INFO accordingly. > > I'll add this stuf to the TODO file. > I'll have ot play with forwrd_requst a little to see what you mean. It might not be a bad idea to forward to fully pathed uri's anyways. At least from a paranoid insecure standpoint. But that could just be me misundersanding sometihg I'm unfamiliar with. -- Mental (Me...@Ne...) There was a power outage at a department store yesterday. Twenty people were trapped on the escalators. --Steven Wright GPG public key: http://www.neverlight.com/Mental.asc |