• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts-2.1.6 -- 'dojo' is undefined

 
Arun Kumar
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you mapping the S2 filter to?
 
Arun Kumar
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the relevant portion of the filter mapping.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are life saver Dave.

This was the quicket solution I found on javaranch.

"/*" worked.

 
Dai Quach
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much! This problem make me crazy.
I changed to "/*" and it works well.
 
Niju Thomas
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One full day i stucked with the same problem..
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic