开发者

Struts2 datetimepicker not showing

开发者 https://www.devze.com 2023-01-26 19:55 出处:网络
I followed THIS but had no luck. My .jsp file has in head tag: <s:head theme=\"ajax\" /> and in body tag

I followed THIS but had no luck.

My .jsp file has in head tag:

<s:head theme="ajax" />

and in body tag

<s:datetimepicker name="dateOfBirth" label="Format (yyyy-MM-dd)" displayFormat="yyyy-MM-dd"/>

But it is not showing, here is the picture:

Struts2 datetimepicker not showing

My generated HTML source code contains all necessary lines like in example (script tags and other are generated....)

Any ideas?

EDIT:

Following Quaternion's answer:

I was using, struts2-core-2.0.12.jar which recognized <s:datetimepicker /> tag but wasn't showing in my jsp page. After replacing struts2-core-2.0.12 with newer one struts2-core-2.2.1.jar, <s:datetimepicker /> tag wasn't recognized.

After putting <%@ taglib prefix="sx" uri="/struts-dojo-tags" %> in head of the file it wasn't recognized as my tag library. Based on THIS, you should download struts2-dojo-plugin-2.1.2.jar开发者_开发问答 separately and add it into your WEB-INF/lib folder (you can downlad it here --> struts-2.1.2-lib.zip --> struts2-dojo-plugin-2.1.2.jar).

After that you just use sx tag for your datetimepicker.

IMPORTANT: Don't forger to put <sx:head/> in head tag of your jsp page --> examples here.


The later versions of struts2 require: <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

Then of course change the tag namespace, using:

<sx:datetimepicker name="dateOfBirth" label="Format (yyyy-MM-dd)" displayFormat="yyyy-MM-dd"/>

See Struts2 datetimepicker It's best if you consult struts.apache.org and ensure you are using the documentation at the correct version, things change!


use sx:head tag in the head section of jsp.


Are you sure you have <%@ taglib prefix="s" uri="/struts-tags" %> included? I miss that at times wondering why things do not show up.

0

精彩评论

暂无评论...
验证码 换一张
取 消