如何从子目录访问 Velocity 模板?
我有一个渲染 VXML 的速度模板
/billing/billingQuestionsMenu_pp.vm
,位于该模板中,我转发到:
<submit next="#springUrl('/billing/billingQuestions/billingQuestionsMenuOption1.vxml')" />
现在在我的控制器中,我有一个映射方法:
@RequestMapping(method = RequestMethod.GET)
public String billingQuestionsMenuOption1(ModelMap model) {
logger.debug("billingQuestionsMenuOption1");
return "/billing/billingQuestions/firstBillMessage_pp";
}
我希望现在调用此方法
/templates/billing/billingQuestions/firstBillMessage_pp.vm
,但它找不到它。
现在如果我将其更改为:
/templates/billing/firstBillMessage_pp.vm
一切正常。
* 如何将我的模板放在子目录中? *
I have a velocity template rendering VXML that is located at
/billing/billingQuestionsMenu_pp.vm
then, in that template, I am forwarding to:
<submit next="#springUrl('/billing/billingQuestions/billingQuestionsMenuOption1.vxml')" />
Now in my Controller, I have a mapped method:
@RequestMapping(method = RequestMethod.GET)
public String billingQuestionsMenuOption1(ModelMap model) {
logger.debug("billingQuestionsMenuOption1");
return "/billing/billingQuestions/firstBillMessage_pp";
}
I want this method to now call
/templates/billing/billingQuestions/firstBillMessage_pp.vm
but it does not find it.
now If I change this to be:
/templates/billing/firstBillMessage_pp.vm
everything works fine.
* How can I have my templates in a sub-subdirectory? *
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一种解决方法似乎只需为每个节点附加附加子目录即可:
There is one work-around that seems to work by just appending the addition sub-directories for each node: