osdir.com
mailing list archive

Subject: include and classpath - msg#00107

List: jakarta.velocity.user

Date: Prev Next Index Thread: Prev Next Index
Hi

I have some problems loading some files using the #include statement

I currently load templates in a Classpath loader, because the templates are shared over multiple apps.

I want to include a static html pages. E.G static/footer.html. I use the #include directive, but it seems to load from classpath too.

Is there a way to include a file relative to the context, while the templates still are loaded from the classpath?

Magne


Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: Velocity related problem --- displaying inly perticular item ina List

Hi Venkat, please place future questions to the velocity-user@xxxxxxxxxxxxxxxxxx list. (You may reply to the dev list only once more - to close this thread if you solved it by now.) As I stated in my previous reply, worded a bit differently: There is a contract between application and template developer, which should be suficiently described as a list of names of the objects in context and the API-Doc of these objects. You can try to find out more about your object by debugging it placing $billgrp.class.name in the template. Then look at the ApiDoc or the interface description for that class. You have some propietary class behind $billgrp, which must be documented somewhere on how you can obtain the desired information from it. Maybe you have to resort scrutinizing the sources of that class. Sorry, but we cannot help you any more, since your questions, example snippets and your followups are not giving us sufficient information to help you. It is up to you to get to know the objects at the template interface and how you must use them. We only can help you giving hints on how to do things with velocity. Regards, Christoph venkat dama wrote: Hi Dave, Thanks for your advice but in template user needs to distinguish which billgroup is displayed.According to your logic the output is(But I have 5 items in the list I need to know which billgroup is displayed like Billgroup1 or Billgroup2 or Billgroup5 ) not clear. $Billgrp:BLDG $Billgrp: REQ Thanks Venkat -- :) Christoph Reck

Next Message by Date: click to view message preview

Re: include and classpath

Hi, you can activate different resource loaders, e.g. multiple file resource loaders with different paths via configuration. This way you may also define a FileResourceLoader and a classpath loader. Read the Manual http://jakarta.apache.org/velocity/developer-guide.html#Velocity%20Configuration%20Keys%20and%20Values in the "Resource Management" section. Also look at the Velocity(View)Servlet to see how to initialize the FileResourceLoader relative to the application context. Cheers, Christoph Magne Skjeret wrote: Hi I have some problems loading some files using the #include statement I currently load templates in a Classpath loader, because the templates are shared over multiple apps. I want to include a static html pages. E.G static/footer.html. I use the #include directive, but it seems to load from classpath too. Is there a way to include a file relative to the context, while the templates still are loaded from the classpath? Magne --------------------------------------------------------------------- To unsubscribe, e-mail: velocity-user-unsubscribe@xxxxxxxxxxxxxxxxxx For additional commands, e-mail: velocity-user-help@xxxxxxxxxxxxxxxxxx -- :) Christoph Reck

Previous Message by Thread: click to view message preview

Re: Velocity related problem --- displaying inly perticular item ina List

Hi Venkat, please place future questions to the velocity-user@xxxxxxxxxxxxxxxxxx list. (You may reply to the dev list only once more - to close this thread if you solved it by now.) As I stated in my previous reply, worded a bit differently: There is a contract between application and template developer, which should be suficiently described as a list of names of the objects in context and the API-Doc of these objects. You can try to find out more about your object by debugging it placing $billgrp.class.name in the template. Then look at the ApiDoc or the interface description for that class. You have some propietary class behind $billgrp, which must be documented somewhere on how you can obtain the desired information from it. Maybe you have to resort scrutinizing the sources of that class. Sorry, but we cannot help you any more, since your questions, example snippets and your followups are not giving us sufficient information to help you. It is up to you to get to know the objects at the template interface and how you must use them. We only can help you giving hints on how to do things with velocity. Regards, Christoph venkat dama wrote: Hi Dave, Thanks for your advice but in template user needs to distinguish which billgroup is displayed.According to your logic the output is(But I have 5 items in the list I need to know which billgroup is displayed like Billgroup1 or Billgroup2 or Billgroup5 ) not clear. $Billgrp:BLDG $Billgrp: REQ Thanks Venkat -- :) Christoph Reck

Next Message by Thread: click to view message preview

Re: include and classpath

Hi, you can activate different resource loaders, e.g. multiple file resource loaders with different paths via configuration. This way you may also define a FileResourceLoader and a classpath loader. Read the Manual http://jakarta.apache.org/velocity/developer-guide.html#Velocity%20Configuration%20Keys%20and%20Values in the "Resource Management" section. Also look at the Velocity(View)Servlet to see how to initialize the FileResourceLoader relative to the application context. Cheers, Christoph Magne Skjeret wrote: Hi I have some problems loading some files using the #include statement I currently load templates in a Classpath loader, because the templates are shared over multiple apps. I want to include a static html pages. E.G static/footer.html. I use the #include directive, but it seems to load from classpath too. Is there a way to include a file relative to the context, while the templates still are loaded from the classpath? Magne --------------------------------------------------------------------- To unsubscribe, e-mail: velocity-user-unsubscribe@xxxxxxxxxxxxxxxxxx For additional commands, e-mail: velocity-user-help@xxxxxxxxxxxxxxxxxx -- :) Christoph Reck
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by