Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This old question became also relevant for me this week when reviewing some existing code. Apart from <a href="https://stackoverflow.com/a/3211887/413020">tbruyelle's answer</a>, this was for me the most helpful reference:</p> <p><a href="http://bodez.wordpress.com/2009/03/13/customising-struts2-jsp-tags/" rel="nofollow noreferrer">http://bodez.wordpress.com/2009/03/13/customising-struts2-jsp-tags/</a></p> <p>In summary<sup>(1)</sup>,</p> <ol> <li>Extend an existing tag (for example, <code>org.apache.struts2.views.jsp.ui.TextFieldTag</code>)</li> <li>Extend its behaviour (for example, <code>org.apache.struts2.components.TextField</code>)</li> <li>Define new theme and templates (for example, copy and edit from an existing theme in <code>/core/src/main/resources/template</code>)</li> <li>Generate the new TLD for the customised version of the taglib</li> <li>Deploy it in a web application</li> </ol> <p>The <a href="https://struts.apache.org/maven/struts2-core/apidocs/org/apache/struts2/components/GenericUIBean.html" rel="nofollow noreferrer" title="GenericUIBean API">struts 2 API</a> could also be helpful.</p> <p>Unfortunately (and surprisingly), there is very little documentation about how to do this, and the javadoc for the existing struts components is "a bit scarce" and misleading. Perhaps it is not intended to be used this way?</p> <hr> <h2>Notes</h2> <p><sup>(1)</sup> I have edited this answer a few years after the original post to add this summary, aligning the answer with SO guidelines. Unfortunately, it's been a long time without working with similar code, and I cannot be sure to have kept the essence of the linked blog, so please refer to the link if it still works.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload