On 7/31/07, Joe Kramer <[EMAIL PROTECTED]> wrote:
> That doesn't help, I still get velocity template on any URL,

then there's some information i'm lacking, 'cause i don't see how
that's possible with what you've told me.  of course, i'm not exactly
a web.xml expert since i rarely find the need to do any complicated
servlet mappings.   if no one else here can help, then you might have
better luck on the mailing list of your servlet engine (Tomcat, Jetty,
etc).  This is really a servlet engine question, not so much a
velocity one.

> and
> navigating to /velocity/ produces Exception:
> org.apache.velocity.exception.ResourceNotFoundException: Unable to
> find resource '/velocity/'

i believe you need to request an actual template, not just a
directory, unless you extend the VVS to map such requests to a
specific template.

>
> On 8/1/07, Nathan Bubna <[EMAIL PROTECTED]> wrote:
> > Change the url-pattern under the servlet-mapping for the velocity
> > servlet to "/velocity/*" instead of "*.vm"
> >
> > On 7/31/07, Joe Kramer <[EMAIL PROTECTED]> wrote:
> > > Helo,
> > >
> > > I have existing webapp with mapped on "/" and "/test"
> > >
> > > I've added VelocityServlet with sample configuration and now on every
> > > request it returns velocity template.
> > > How do I configure VelocityServlet so it answers requests only under
> > > "/velocity" context?
> > >
> > > Here's configuration:
> > >
> > > <web-app>
> > > <servlet>
> > >     <servlet-name>webcontext</servlet-name>
> > >     <servlet-class>MyServlet</servlet-class>
> > >   </servlet>
> > >   <servlet-mapping>
> > >     <servlet-name>webcontext</servlet-name>
> > >     <url-pattern>/</url-pattern>
> > >   </servlet-mapping>
> > > <servlet>
> > >     <servlet-name>othercontext</servlet-name>
> > >     <servlet-class>MyOtherServlet</servlet-class>
> > >   </servlet>
> > >   <servlet-mapping>
> > >     <servlet-name>othercontext</servlet-name>
> > >     <url-pattern>/test</url-pattern>
> > >   </servlet-mapping>
> > >
> > >   <servlet>
> > >     <servlet-name>velocity</servlet-name>
> > >     
> > > <servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</servlet-class>
> > >   </servlet>
> > >   <servlet-mapping>
> > >     <servlet-name>velocity</servlet-name>
> > >     <url-pattern>*.vm</url-pattern>
> > >   </servlet-mapping>
> > >   <welcome-file-list>
> > >     <welcome-file>index.vm</welcome-file>
> > >   </welcome-file-list>
> > > </web-app>
> > >
> > >
> > >
> > > Thanks.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to