velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nat...@esha.com>
Subject Re: velocity-tools -> multiple instances of VelocityViewServlet
Date Fri, 09 May 2003 01:36:20 GMT
Dmitri said:
...
> > > I'm using velocity-tools, and have tried to have two instances
of
> > > VelocityViewServlet, mainly to set the mime-time for a
particular
> > request.
> > > Anyway, I found that the tools didn't seem to be included for
> > requestes
> > > going through the second instance
> >
> > hmm.  it would help to know a little bit about your setup,
> > particularly your web.xml, what container you are using, and what
> > scope you are giving your tools in your toolbox.xml.
>
> ahhh - sorry.  tomcat 4.1.8, java 1.4.1_02, using Struts 1.1b2
...
> my web.xml had two servlets (and mappings) - one for
VelocityViewServlet
> (again from the examples), and then another called HTAServlet, that
was a
> subclass of VelocityViewServlet, that did very little, apart from
set the
> content type to application:hta and process the template.

ok, one thing in particular i was looking for was where you were
specifying the toolbox:  as an application init-params or in each of
the servlets' init params?  i'm guessing it was the latter.  if so,
the next question would be: did both configurations point to the same
toolbox file?

...
> I now have VelocityViewServlet (or rather my subclass) mapped to
*.vm and
> *.hta, and in my subclass I override the setContentType method to
set it
> appropriately.

yeah, this would be the recommended approach if all you are doing is
switching the content-type according to the requested file name.
that's why the setContentType method is passed the request and
response.

so, yeah, i'm glad you got it working, but since someone might
theoretically run into this problem and not be free to use your
workaround, would you mind still answering my follow-up questions
about your previous setup?  i might still try and track down the
problem when i get a chance.

Nathan Bubna
nathan@esha.com


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


Mime
View raw message