How to force relative pathing with Struts 2.1 and Dojo?

自古美人都是妖i 提交于 2020-01-07 06:54:21

问题


I upgraded from Struts 2.0.6 to 2.1.6 and converted all my Ajax themes to plugins. Everything works except the pathing has changed from relative to absolute. For example, here is the rendered HTML before upgrade:

<script type="text/javascript" src="../struts/simple/dojoRequire.js"></script>

And here it is after upgrade:

<script language="JavaScript" type="text/javascript" src="/myApp/struts/ajax/dojoRequire.js"></script>

Somehow the absolute "/myApp" is getting used instead of the relative ".." path.

Does anyone know how to force it to use the old-way of pathing?

Thanks for any tips.


回答1:


I had to add baseRelativePath="../struts/dojo"

to the sx: head tag to get it to work.

I think this is actually a bug in the Dojo plugin (or at least should be documented that the 2.1 upgrade changes things, but I am happy it is working.

Scott



来源:https://stackoverflow.com/questions/1444546/how-to-force-relative-pathing-with-struts-2-1-and-dojo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!