Re: Overriding Templates

2010-10-21 Thread Li Ying
I have reported it to JIRA as a BUG. https://issues.apache.org/jira/browse/WW-3522 If the develop team confirm that it really is a bug, then I will add information to the docs. - To unsubscribe, e-mail:

RE: Overriding Templates

2010-10-20 Thread adam pinder
changed in later version and developer didn't realise full implications. anyway, the addition of the context-param sorted out my problem. thanks for your responses adam Date: Wed, 20 Oct 2010 12:01:34 +0900 Subject: Re: Overriding Templates From: liying.cn.2...@gmail.com To: user

Re: Overriding Templates

2010-10-20 Thread Li Ying
Just add this to your web.xml:    context-param        param-nametemplatePath/param-name        param-valuetemplate/param-value    /context-param The param [templatePath] can start with only class:// or file://. Otherwise, struts will ignore it and do not create a TemplateLoader for it.

Re: Overriding Templates

2010-10-20 Thread Dave Newton
So you're saying it doesn't work for him? Dave On Wed, Oct 20, 2010 at 5:26 AM, Li Ying liying.cn.2...@gmail.com wrote: Just add this to your web.xml:    context-param        param-nametemplatePath/param-name        param-valuetemplate/param-value    /context-param The param

Re: Overriding Templates

2010-10-20 Thread Li Ying
No, I mean it works, but the value template has no meaning. Actually, if you set param [templatePath] (or [TemplatePath]) to any string which not start with class:// or file://, you will get the same result: templates under web root folder will be loaded. If you delete this param from web.xml,

Re: Overriding Templates

2010-10-20 Thread Dave Newton
It's actually more likely the documentation needs to be updated. Perhaps you could get edit access to the wiki and update them? Dave On Wed, Oct 20, 2010 at 8:47 AM, Li Ying liying.cn.2...@gmail.com wrote: No, I mean it works, but the value template has no meaning. Actually, if you set param

Re: Overriding Templates

2010-10-20 Thread Li Ying
If I am the author of this code, i think the priority order of these 3 TemplateLoaders should be: 1, WebappTemplateLoader 2,ClassTemplateLoader (when value of param [templatePath] is string starts with class://) or FileTemplateLoader(when value of param [templatePath] is string starts with

Re: Overriding Templates

2010-10-20 Thread Dave Newton
You know that (a) the dev team reads this list, and (b) I'm on the dev team, right? On Wed, Oct 20, 2010 at 9:19 AM, Li Ying liying.cn.2...@gmail.com wrote: If I am the author of this code, i think the priority order of these 3 TemplateLoaders should be: 1, WebappTemplateLoader

Re: Overriding Templates

2010-10-20 Thread Li Ying
Actually I did not know about these, Sorry. And (A)I am just a new guy of Struts2 community, if I put some message into the Struts2 docs and it is not right, I will mislead so many users, I will feel so~~~ sorry. (B)As you can see, my English is not good. 2010/10/20 Dave Newton

Re: Overriding Templates

2010-10-20 Thread Dave Newton
(A)I am just a new guy of Struts2 community, if I put some message into the Struts2 docs and it is not right, I will mislead so many users, I will feel so~~~ sorry. Honestly, I'd rather see the documentation reflect current behavior, whether or not the behavior itself is correct. And if the

Re: Overriding Templates

2010-10-20 Thread Li Ying
OK, I will do it, But maybe tomorrow, because the local time is over 11PM now. 2010/10/20 Dave Newton davelnew...@gmail.com: (A)I am just a new guy of Struts2 community, if I put some message into the Struts2 docs and it is not right, I will mislead so many users, I will feel so~~~ sorry.

Re: Overriding Templates

2010-10-20 Thread Dave Newton
All help is greatly appreciated :) Thanks! Dave On Wed, Oct 20, 2010 at 10:26 AM, Li Ying liying.cn.2...@gmail.com wrote: OK, I will do it, But maybe tomorrow, because the local time is over 11PM now. 2010/10/20 Dave Newton davelnew...@gmail.com: (A)I am just a new guy of Struts2

RE: Overriding Templates

2010-10-19 Thread adam pinder
; PADDING-TOP: 10px; WIDTH: 100%; text-align: center #list actionErrors as error p class=ui-state-highlight${error}/p /#list /div /#if Adam Date: Tue, 19 Oct 2010 11:39:13 +0900 Subject: Re: Overriding Templates From: liying.cn.2...@gmail.com To: user@struts.apache.org Hi adam: what theme

Re: Overriding Templates

2010-10-19 Thread Li Ying
With a lot of debugging, I think i have found what's wrong. If you use the default setting, In method [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager], Struts will create 3 TemplateLoader which is: 1,ClassTemplateLoader, which will load Template from class

Re: Overriding Templates

2010-10-19 Thread Maurizio Cucchiara
@Adam and they were placed into WebContent\template\simple folder you should start to investigate about your path correctness IMHO . Struts usually finds freemarker template inside your classpath. In order to enable struts to find your custom template file, you should ensure that template files

Re: Overriding Templates

2010-10-19 Thread Li Ying
Hi Maurizio: In this document: http://struts.apache.org/2.2.1/docs/template-loading.html It says the template should be searched in (in this order): 1, web app folder 2, class path But i have read the Struts2.2.1 source code, it creates TemplateLoader in a different order, as i described in my

Overriding Templates

2010-10-18 Thread adam pinder
jar file correctly... with 2.2.1 it's now always using the templates in the struts2 core jar even though i can see inside this jar the folder structure and filenames have not changed.. with 2.2.1 do you need to place the overriding templates in a different folder for it to work ? note. i

Re: Overriding Templates

2010-10-18 Thread Li Ying
correctly... with 2.2.1 it's now always using the templates in the struts2 core jar even though i can see inside this jar the folder structure and filenames have not changed.. with 2.2.1 do you need to place the overriding templates in a different folder for it to work ? note. i have