2

When I use the tag

<s:datetextfield format="dd-MM-yyyy"></s:datetextfield>

(where s is a prefix for struts tag) I get an exception:

org.apache.jasper.JasperException: Template not found for name "/template/bootstrap/datetextfield.ftl".

Do I have to declare/instantiate some date format object and pass it ?

Roman C
  • 49,761
  • 33
  • 66
  • 176
Dame Lyngdoh
  • 312
  • 4
  • 18

2 Answers2

2

It seems you're using the struts2-bootstrap-plugin, with the bootstrap theme;

it also seems that the bootstrap theme is unprovided of the freemarker template for the <s:datetextfield /> tag.

Following the logic, the solution is to use a theme (for that tag only) that is provided of the appropriate .ftl, in the following way:

<s:datetextfield format="dd-MM-yyyy" theme="simple" />

This however is a non-standard situation... it's the first time I see it happens. There is also a JIRA report about this, WW-4434.

I'm not sure what that tag does since I've neved used it and the documentation is broken, but if it's just about textfields, dates and datepickers, consider using native HTML5 datepickers (<s:textfield type="date"/>) with appropriate fallbacks.

Community
  • 1
  • 1
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
1

I had this error and solved it this way:

<s:textfield name="date" type="date"
                     format="dd-MM-yyyy" label="BirthDate" />
jps
  • 20,041
  • 15
  • 75
  • 79
adelagd
  • 33
  • 9