File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts 2 - DateTimePicker Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 - DateTimePicker" Watch "Struts 2 - DateTimePicker" New topic
Author

Struts 2 - DateTimePicker

Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

I'm trying to implement the 'easy to use' datetimepicker (or datepicker) for a Struts 2 application based on this example and I'm getting the following error when I use the tag:

org.apache.jasper.JasperException: /MyApp.jsp(21,1) No tag "datetimepicker" defined in tag library imported with prefix "s"

I opened up the struts-tags.tld library for 2.1.6 and I don't see the tag defined. I'm guessing I'm missing a library but I can't tell which one.

My Blog: Down Home Country Coding with Scott Selikoff
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

I think I found the solution... I added the "struts2-dojo-plugin-2.1.6.jar" to my class-path and I added a second tag library:

<%@taglib prefix="d" uri="/struts-dojo-tags"%>

I must have 'missed' the documentation that covered these steps.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The S2.1 series release notes discuss the move to a Dojo tag plugin and the Ajax tag documentation includes the same information. As has been noted by others here on JavaRanch, RoseIndia isn't always your best bet for reliable, current information.
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

RoseIndia seems to come up with a lot of examples in google. Either way I'm still having trouble with the datetimepicker. The code compiles and runs, but it doesn't do much, as in, I see "Enter Date:" but that's about it. What other config do I need to add/install to make it work?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Number of hits != useful.

Do you have the <sx:head/> tag in your pages <head> section? (Also in the S2 docs.)
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Ah, that did it. I saw an empty tag when the include ajax theme was taken out, and just 'assumed' it wasn't do anything anymore. My bad.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 - DateTimePicker