You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Nathan Bubna <na...@esha.com> on 2003/02/13 05:40:35 UTC

Re: [veltools] VelocityViewServlet internal stuff

Anthony said:
> 1) Why is there a wrapper (VelocityStrutsServletAppContext)
> to "safely" pass ServletContext to other parts of the app?
> It is being passed by reference anyway, and a copy is
> not being made, so I see no extra safety in this. If it is to
> avoid someone putting something wierd in its place for a later
> app module to find, can't the same thing happen with the wrapper?
> IMHO, it would be advantageous to store the
> ServletContext itself under a standardized key, which would
> then allow a custom resource loader or logger to find it
> (if it needed it).

you know, i've never really looked at this stuff before.  when i don't write
it myself or have any problems with it, i just tend to glaze over sometimes.
:)  anyway, yeah, at first glance, i don't see why the wrapper is
needed/useful either  (and that attribute key should really be a constant
somewhere!).

Geir?  are you out there?  i'm assuming there's a reason it was done this
way.  is there still a reason?

> 2) On logging. It looks as if the user need only supply a derivation
> of LogSystem classname in a property, and then something like
> the following might work:
>
> a. Put ServletContext under a well-known key (see (1))
> b. Get the logger class name from properties
>    b.2 default to current ServletLogger if not specified
> c. Load the class and instantiate (no-arg constructor)
>    c.2 insure object is instanceof LogSystem
>    c.2 Class can get ServletContext from well-known key
> d. Put LogSystem instance into Velocity
>
> 3) Resource loader. Correct me if I'm wrong, but you want the
> resource loader to be configurable so that someone can do
> something wiggy like load templates from a database or
> network server? If the ServletContext is under a well-known
> key, a solution similar to the logging one I just proposed
> would probably be just fine, no?


these sound reasonable, but as i said, i haven't looked into the
code/problem carefully.  i may try to look thru this myself in the next week
or so, but in the meantime, feel free to try it out yourself and let us know
if it works.  if it does, send a patch and i'll give it a go.  code is a lot
easier (and less time-consuming) for me to evaluate than suggested plans
are. :)

Nathan Bubna
nathan@esha.com


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


Re: [veltools] VelocityViewServlet internal stuff

Posted by Anthony Kay <aw...@yahoo.com>.
> or so, but in the meantime, feel free to try it out yourself and let
> us know
> if it works.  if it does, send a patch and i'll give it a go.  code
> is a lot
> easier (and less time-consuming) for me to evaluate than suggested
> plans
> are. :)

Sure, I understand that. I was just running it by to see if anybody
was going to pop up with "that won't work because..." since I'm
pretty new to the code base, and might be suggesting something
that someone has immediate advice on.

I will give the suggested implementation a go, and build at least one
example, and perhaps even a test case or two.


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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