• 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
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Struts 2 and Dojo (dojo undefined error)

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am trying to learn struts2, and what I want to do is display a datetimepicker on a jsp. From tutorials, it seems like I can use dojo to do it. But when I display the page, I get a "dojo is undefined" error, and sure enough, firebug tells me it is not able to locate the dojo js files.

This is how I am doing it. Can you please point me towards what I am missing.

1. jsp page:
In the HEAD section: <s:head theme="ajax" />
In the BODY section:
<s atetimepicker name="deliveryDate" displayFormat="yyyy-MM-dd"/>

2. in web.xml:
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

3. I have struts2-core-2.0.12.jar in the build path, which seems to contain all the js files that the jsp looks for, but I dont know why they don't get read. In desperation, I tried extracting the jars into the path that firebug showed me eg: /MyProject/struts/ajax/dojo/dojo.js, but I was just getting other errors, and I gave it up because that didnt seem to be right solution anyways.

It seems so simple on the tutorial site, but I have spent an unbelievable amount of time trying to get it to work. Any and all help greatly appreciated. Thanks much.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IIRC there's a know issue w/ 2.0.12; try upgrading.
 
Casey Cox
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the idea. I will give it a try.
 
Casey Cox
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It turns out my web application's structure was not entirely ideal. There wasn't a webroot folder housing the web-inf and other folders. Once I rearranged the project, dojo starting work properly. Whew!!

Thanks all!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic