1
votes

I want to extend Struts 2 s:select tag. Can somebody explain step required to do the same. Also if there is any hook or implementation available in Struts2 framework for the same

2
What exactly you want to do with <s:select> tag? - Aleksandr M
I want to write a kind of wrapper to this tag where i can write custom functionality. - Mangesh Jogade

2 Answers

4
votes

I think you can change the freemarker template as you need and extend org.apache.struts2.views.jsp.ui.SelectTag class.

Check this article to start with.

1
votes

You can start by examining the freemarker templates (default is freemarker but it can be velocity or some other template engine). See http://mikeski.net/site/node/16.

If that is not enough for you then you could extend or create your own implementation of select tag. http://joshuajava.wordpress.com/2008/12/27/creating-custom-components-with-struts-2/