“StrutsUtils 未定义”错误

今天在页面使用s:optiontransferselect,遇到“StrutsUtils 未定义”错误

struts2.1.6

s:optiontransferselect 

没有加载 Struts2 js

已加 <s:head />

源文件编译后在页面添加:

<script src="/xxxx/struts/utils.js" type="text/javascript"></script>
 

原因:

web.xml中

Struts没拦截js文件,需加如:

<filter-mapping>
 <filter-name>struts2</filter-name>
 <url-pattern>*.js</url-pattern>
</filter-mapping>
 

猜你喜欢

转载自hbxflihua.iteye.com/blog/1416521