Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!

Marc Bouvier

Greenhorn
+ Follow
since Jan 27, 2014
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marc Bouvier

You can make your own taglib extending textfield. and using a different template which only aim is to replace

<input type="text"

by

<input type="date"



If you need more attributes (date range ...) you may need to add them in the tld descriptor and in the component class.

In your own tld file (here WEB-INF/tlds/mytld.tld) :


Tag class : DateFieldTag, we just extend Struts2 TextFieldTag and use our own component DateField instead of TextField



Component class : We extend Struts2 TextField component and make it use our own template (datefield) which will find datefield.ftl template



Do not forget to create a template for your taglib (here simple/datefield.ftl)




Then you will have to include your tld in your web.xml file




And use it in your JSP page

6 years ago