I wonder if anyone can help.
I'm putting together a S2 application and have used "struts.custom.properties" in struts.properties to point to a properties file with my own application specific properties within it. Essentially the properties that I am providing are a series of application defaults.
Within a component class I can reference these properties with DI like this:
This works great and I can then reference layoutCol1 within my component class. However, I need access to these properties within my ftl templates, and ideally I want to do away with using DI to access them in my class.
What I'd like to do in my ftl is something like:
But I just cant get it. Either I've got the syntax wrong; or I've misunderstood the concept of properties (in properties files) vs. paramaters vs. OGNL vs. stacks
If anyone could point me in the right direction I'd very much appreciate it;
Use the s:text tag, if you're just getting labels.
Joined: Aug 18, 2004
Thank you for your reply. My values in my properties file are more used to control logic of the application, rather than labels as such (even though I've used the phrase 'label' in my example). What I need to do in my ftl template is perform some logic based on the values of the properties, hence me wanting to do something like
What I'm trying to achieve is that I have a properties file that contains defaults for how the web app is laid out - ie. the default for column 1 is the field label; but these defaults can be overridden by using extra attributes that I've added to the tld for each field type so that for a given field you can say that column 1 has the field itself and column 2 has the label
Does this explain better what I'm trying to do?
Joined: Aug 18, 2004
Ive just though about my last post and thought might be serving to confuse!, so here is (hopefully) a better example.
I want to do something like this in my ftp template:
where layoutCol1FromTagAttributes and layoutCol1FromTagAttributes are optional attributes on the tag and if provided on the tag are added as parameters in the component class; and defaultLayoutCol1FromPropsFile and defaultLayoutCol2FromPropsFile are properties in my custom properties file.
So, back to the original question, how do I reference defaultLayoutCol1FromPropsFile and defaultLayoutCol2FromPropsFile in the ftl file in the way I am trying to?