aspose file tools*
The moose likes Struts and the fly likes struts-2.1.6  -- 'dojo' is undefined Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts-2.1.6  -- Watch "struts-2.1.6  -- New topic
Author

struts-2.1.6 -- 'dojo' is undefined

Arun Kumar
Ranch Hand

Joined: May 22, 2006
Posts: 62
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

Joined: May 22, 2006
Posts: 62
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

Joined: Sep 29, 2008
Posts: 12617

What are you mapping the S2 filter to?
Arun Kumar
Ranch Hand

Joined: May 22, 2006
Posts: 62
This is the relevant portion of the filter mapping.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: May 22, 2006
Posts: 62
You are life saver Dave.

This was the quicket solution I found on javaranch.

"/*" worked.

Dai Quach
Greenhorn

Joined: Aug 17, 2004
Posts: 1
Thank you very much! This problem make me crazy.
I changed to "/*" and it works well.
Niju Thomas
Greenhorn

Joined: Jul 29, 2011
Posts: 13
One full day i stucked with the same problem..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts-2.1.6 -- 'dojo' is undefined