This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 2 - DateTimePicker Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Struts 2 - DateTimePicker" Watch "Struts 2 - DateTimePicker" New topic
Author

Struts 2 - DateTimePicker

Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3666
    
    2

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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3666
    
    2

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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3666
    
    2

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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3666
    
    2

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Struts 2 - DateTimePicker
 
Similar Threads
struts2 datetimepicker issue
datetimepicker
autocompleter and datetimepicker not working in Struts 2
Readonly attribute for dateTimePicker
Struts 2: datetimepicker tag