struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sami Dalouche <sko...@free.fr>
Subject RE: Struts 2 Themes
Date Tue, 09 Oct 2007 17:54:31 GMT
Hi,

your best bet is to look at S2's source code. You can start by looking
at org.apache.struts2.views.freemarker.tags.StrutsModels.
Each of the tags have an associated "Model", and S2 taglib's models are
registered in this class.

So, for instance, if you look for TextField's template name :
1] There is a "TextFieldModel" instance declared
2] So, you look at
org.apache.struts2.views.freemarker.tags.TextFieldModel#getBean() :
3] You can see "return new TextField(stack, req, res);"
4] So, you look at org.apache.struts2.components.TextField
5] You can see : final public static String TEMPLATE = "text";

=> So, the template name is "text" ;)

Regards,
Sami Dalouche



Le mardi 09 octobre 2007 à 13:07 -0400, Jiang, Jane (NIH/NCI) [C] a
écrit :
> Sorry, my fault.  I did not notice the code I used to test checkbox
> defined the theme inside the tag.  So checkbox.ftl is the template for
> s:checkbox.  I would still like to find out if there is a general rule
> for map the tag to template and other resource to learn about theme.
> 
> -----Original Message-----
> From: Jiang, Jane (NIH/NCI) [C] 
> Sent: Tuesday, October 09, 2007 12:57 PM
> To: Struts Users Mailing List
> Subject: Struts 2 Themes
> 
> I am trying to get a better understanding of S2 themes.  I read the
> document and the create themes page in the cookbook.  
> 
> My question is how I can find the right template file for a tag.  I
> tried to change text.ftl and found that ties to s:textfield.  I am now
> trying to figure out what is the one for checkbox.  I thought it would
> be the checkbox.ftl.  But s:chechbox does not change at all when I
> changed the checkbox.ftl.  What about s:property? 
> 
> Where can I find more information if I want to get more into the themes?
> 
> Thanks a lot for your help,
> 
> Jane
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message