• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts-2.1.6 -- 'dojo' is undefined

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to run this small example with struts-2.1.6 and I get this error on the simple jsp page that I paste below.

I am not sure what is missing there I am not able to get rid of this problem.


 
Arun Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry i missed that

commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.0.4.jar
freemarker-2.3.13.jar
json-lib-2.1.jar
ognl-2.6.11.jar
struts2-core-2.1.6.jar
struts2-dojo-plugin-2.1.6.jar
xwork-2.1.2.jar

Above jars are in the classpath.
 
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
What are you mapping the S2 filter to?
 
Arun Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the relevant portion of the filter mapping.

 
David Newton
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
Well, that won't work well unless you've extracted the static files out of the Struts jar.

As the S2 documentation states, the expected filter mapping is "/*". This is because Struts contains static files (the Dojo libraries, in this case), and expects to see *every* request, so it can serve those files.

By mapping to something other than the recommended mapping you're bypassing the default S2 behavior, and must adjust your deployment accordingly.
 
Arun Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are life saver Dave.

This was the quicket solution I found on javaranch.

"/*" worked.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much! This problem make me crazy.
I changed to "/*" and it works well.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One full day i stucked with the same problem..
reply
    Bookmark Topic Watch Topic
  • New Topic