|
Re[2]: Newbie - Keep getting ResourceNotFoundException: msg#00190jakarta.velocity.user
Well I have searched the archives, and found a lot, but nothing that helped me :( I want total controll over my servlet, so I rather not use the VelocityServlet. I don't understand why my Servlet has problems finding the template, since I give it the correct path to it, I even tried to give it the HTTP path like this "/myproject/mytemplate.yaf" (and if I requested this path manually with my browser, I would get the template file). Could you maybe explain to me what can possible be wrong, do I need to initialize something, or what is it? /Søren Tuesday, November 26, 2002, 8:54:54 PM, Jeff wrote: JD> You servlet is having a problem finding the template. If you search the archives you find a bunch of articles that explain how to fix this. JD> Instead I think it is easier to get started with Velocity in Servlets by using VelocityServlet and extending it. This does most of the initalization stuff. JD> HTH, JD> Jeff JD> Søren Neigaard wrote: >> I'm trying to make a simple HelloWorld example, and I'm doing this >> from inside the doGet method in a servlet: >> >> ------------------ >> Velocity.init(); >> VelocityContext context = new VelocityContext(); >> context.put("name", new String("Velocity Test")); >> Template template = null; >> try { >> template = Velocity.getTemplate("mytemplate.vm"); >> template.merge(context,response.getWriter()); >> } >> catch(Exception e){ >> e.printStackTrace(); >> } >> ------------------ >> >> Where does it look for the template? Can it be on the file system, or >> must it be accessible via HTTP? I have now tried to pint it directly >> to the path where the file is, and i get this error: >> >> ------------------ >> org.apache.velocity.exception.ResourceNotFoundException: Unable to >> find resource >> '/C:/jakarta-tomcat-4.1.10-LE-jdk14/webapps/yaf/mytemplate.vm' >> ------------------ >> >> And the file is there!? Please advice, what is my (simple) problem? >> >> -- >> Med venlig hilsen/Best regards, >> Søren Neigaard mailto:neigaard@xxxxxxxx |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Sending values to a #parsed template...: 00190, Christoph . Reck |
|---|---|
| Next by Date: | Re: Sending values to a #parsed template...: 00190, Rodrigo Reyes |
| Previous by Thread: | Re: Newbie - Keep getting ResourceNotFoundExceptioni: 00190, Jeff Duska |
| Next by Thread: | Re: Newbie - Keep getting ResourceNotFoundException: 00190, Matthew Walker |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |