When running the project today, the page suddenly reports the error "dojo undefined "! It's strange. It was okay yesterday. Why did this problem occur today? In <SCRIPT type = "text/JavaScript" scr = "/dojo. JS "> after specifying the path of the dojo library file, it still does not work. It is depressing. As a result, I searched the internet and found a renxiong had a problem similar to mine. I suddenly realized it after reading his explanation. It turns out that, like him, I changed some configuration in Web. xml at the end of yesterday. The original configuration is as follows:
<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>
I changed it:
<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> *. Action </url-pattern>
</Filter-mapping>
<Filter-mapping>
<Filter-Name> struts2 </filter-Name>
<URL-pattern> *. jsp </url-pattern>
</Filter-mapping>
As a result, the. js file does not go through filterdispatcher. if you have a. CSS file in your project, it will also cause problems.
After finding the problem, I will continue to add it in the configuration file:
<Filter-mapping>
<Filter-Name> struts2 </filter-Name>
<URL-pattern>/struts/* </url-pattern>
</Filter-mapping>
After testing, everything is normal.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/gavin812428144/archive/2010/03/22/5405728.aspx