aspose file tools*
The moose likes Struts and the fly likes Struts 2 and html5 input tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 and html5 input tags" Watch "Struts 2 and html5 input tags" New topic
Author

Struts 2 and html5 input tags

Nancy C Johnson
Greenhorn

Joined: Aug 07, 2012
Posts: 4
How would I code <input type=email into Struts sytnax? I don't see anything but S:textfield
Thank You

Nancy Johnson
Manjesh Patil
Ranch Hand

Joined: Sep 24, 2010
Posts: 41

Struts2 as of now does not seems to be supporting HTML5. you have to use s:textfield only.
here is the list of HTML elelments that struts2 tags can render....


http://struts.apache.org/2.0.6/docs/ui-tag-reference.html



regards
Manjesh
Nancy C Johnson
Greenhorn

Joined: Aug 07, 2012
Posts: 4
Thank you. Do you think Struts 2 will begin to support HTML5 tags in the near future?

Thank you.

Nancy Johnson
Manjesh Patil
Ranch Hand

Joined: Sep 24, 2010
Posts: 41

I wish some plugin would come up though I do not see any roadmap for struts2 on their official site.
Marc Bouvier
Greenhorn

Joined: Jan 27, 2014
Posts: 1
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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 and html5 input tags