Castle Nvelocity GetTemplate 方法不起作用
我一直在尝试按照 此 说明使用 NVelocity 实现电子邮件模板,但是我不断从 GetTemplate 方法中收到资源未找到异常。
我已经使用了 Server.MapPath 完整路由和相对路由,但无法使其工作。
I've been trying to follow this instructions to implement email templating using NVelocity but I keep getting a resource not found exception from the GetTemplate method.
I've used Server.MapPath full routes and also relative routes and haven't been able to make it work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该问题与我使用的 NVelocity 程序集的版本有关。
The problem was related to the version of the NVelocity assembly I was using.
既然您提到了 Server.MapPath,我就猜测这是针对网页的。万一,这是在 MonoRail 网站上吗?如果是这样,那么控制器对象上有用于从网页发送电子邮件的方法,这使得它变得更简单(并且模板位于 Views/email 文件夹中。)
Since you mention Server.MapPath, I'm going to guess that this is for a web page. In case, is this in a MonoRail Website? If so, then there are methods on the Controller object for sending emails from a webpage, which make it much simpler (and the templates go in Views/email folder.)