为 Jetty 配置 Javamail JNDI
我的目标很简单。使用 javamail 的 JNDI 配置 maven-jetty-plugin。
但经过几个小时的谷歌搜索和阅读后,我无法弄清楚到底该怎么做……
有人可以帮助我提供一个简单的分步说明吗?
我刚刚阅读了 http://docs.codehaus.org/display/JETTY/JNDI,但是绝对没有关于我应该编辑哪个文件的信息......
例如。我应该把这个放在哪里???
<Configure id='wac' class="org.mortbay.jetty.webapp.WebAppContext">
...
<New id="mail" class="org.mortbay.jetty.plus.naming.Resource">
<Arg><Ref id="wac"/></Arg>
<Arg>mail/Session</Arg>
<Arg>
<New class="org.mortbay.naming.factories.MailSessionReference">
<Set name="user">fred</Set>
<Set name="password">OBF:1xmk1w261z0f1w1c1xmq</Set>
<Set name="properties">
<New class="java.util.Properties">
<Put name="mail.smtp.host">XXX</Put>
<Put name="mail.from">me@me</Put>
<Put name="mail.debug">true</Put>
</New>
</Set>
</New>
</Arg>
最后。由于这是 maven-jetty-plugin,我无权修改任何核心文件,所以我是否应该创建和设置某种 xml 文件来覆盖 jetty 原始配置?
My goal is simple. Configure the maven-jetty-plugin with a JNDI for javamail.
But after hours of googling and reading i cannot figure out exactly what to do....
Can someone please help me with a simple step-by-step instruction.
I just read the documentation at http://docs.codehaus.org/display/JETTY/JNDI, but there is absolutly no information about what file i should be editing...
For example. Where am i supposed to put this???
<Configure id='wac' class="org.mortbay.jetty.webapp.WebAppContext">
...
<New id="mail" class="org.mortbay.jetty.plus.naming.Resource">
<Arg><Ref id="wac"/></Arg>
<Arg>mail/Session</Arg>
<Arg>
<New class="org.mortbay.naming.factories.MailSessionReference">
<Set name="user">fred</Set>
<Set name="password">OBF:1xmk1w261z0f1w1c1xmq</Set>
<Set name="properties">
<New class="java.util.Properties">
<Put name="mail.smtp.host">XXX</Put>
<Put name="mail.from">me@me</Put>
<Put name="mail.debug">true</Put>
</New>
</Set>
</New>
</Arg>
And lastly. Since this is the maven-jetty-plugin, i do not have access to modify any core files, so should there be some kind of xml file i should create and set up to override jetty original configuration?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将以下配置添加到 maven-jetty-plugin:
然后,您可以将该文件放置在该位置。
以下是具体示例:
Add the following configuration to the maven-jetty-plugin:
Then, you can place that file in that location.
Here are concrete examples: