• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Struts 2 and html5 input tags

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How would I code <input type=email into Struts sytnax? I don't see anything but S:textfield
Thank You

Nancy Johnson
 
Ranch Hand
Posts: 42
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 42
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wish some plugin would come up though I do not see any roadmap for struts2 on their official site.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic