如何强制使用Struts 2.1和Dojo的相对路径? [英] How to force relative pathing with Struts 2.1 and Dojo?

查看:150
本文介绍了如何强制使用Struts 2.1和Dojo的相对路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Struts 2.0.6升级到2.1.6,并将我所有的Ajax主题转换为插件。一切工作,除了路径从相对绝对变化。例如,这里是升级前呈现的HTML:

 < script type =text / javascriptsrc =.. /struts/simple/dojoRequire.js\"></script> 

这是升级后:

 < script language =JavaScripttype =text / javascriptsrc =/ myApp / struts / ajax / dojoRequire.js>< / script> 

不知何故绝对的/ myApp正在被使用而不是相对的..路径。 / p>

有没有人知道如何强制使用旧的路径?



感谢任何提示。

解决方案

我不得不添加baseRelativePath =../ struts / dojo



到sx:head标签,以使其正常工作。



我认为这实际上是Dojo插件中的一个错误(或至少应该记录在案2.1升级改变了事情,但我很高兴它正在工作。



Scott


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.

解决方案

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

这篇关于如何强制使用Struts 2.1和Dojo的相对路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆