|
Re: Newbie - Keep getting ResourceNotFoundException: msg#00211jakarta.velocity.user
If you already solve the problem, ignore - my scan of the list didn't seem to have any help for you... On Tuesday, November 26, 2002, at 02:36 PM, Søren Neigaard wrote: I'm trying to make a simple HelloWorld example, and I'm doing this It's a simple problem. First, some comments : 1) you don't want to put init() in the doGet(). First, it's not going to work after the first time, and two, it's much better to put this into the servlets' init method, so it will get called at the right time in the servlet life cycle. 2) There is nothing wrong with rolling your own servlet - it's what I do and can customize things the way I want them to be. VelocityServlet is a nice base, and it has a nice model to work with, but there are many ways to do it. 3) The problem - the problem is that by default, velocity's resource loader is the FileResourceLoader, and further, it defaults to the 'current directory', whatever that is, when init()-ed w/o parameters. The solution is really simple - you want to set the file resource loader path with the right thing - see how VelocityServlet does it, or the servlet examples in the distro. Other solutions is to use the webapp resource loader from the tools project as well, as that is meant to not depend on the filesystem, which is the better thing to do in a servlet environment. geir -- Geir Magnusson Jr 203-355-2219(w) Adeptra, Inc. 203-247-1713(m) geirm@xxxxxxxxxxx |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Default to quiet references: 00211, Peter Romianowski |
|---|---|
| Next by Date: | Contexts and Profiling: 00211, Michal Chmielewski |
| Previous by Thread: | Re[2]: Newbie - Keep getting ResourceNotFoundExceptioni: 00211, Søren Neigaard |
| Next by Thread: | Re[2]: Newbie - Keep getting ResourceNotFoundException: 00211, Søren Neigaard |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |